amharic-name-search
# Amharic Name Search
A lightweight TypeScript library for transliterating and matching Ethiopian names in both English and Amharic scripts. Perfect for building bilingual search functionality.
> **Note:** This is a transliteration library, not a search engine. Use it with databases (MongoDB, PostgreSQL), search engines (Elasticsearch), or for client-side filtering.
>
## Quick Start
```bash
npm install amharic-name-search
```
```typescript
import { matchesName } from 'amharic-name-search';
// Search works in both directions!
matchesName('አማኑኤል', 'amanuel'); // true ✅
matchesName('Amanuel', 'አማኑኤል'); // true ✅
// NEW: Romanization-based partial matching
matchesName('አማኑኤል', 'Ama'); // true ✅
matchesName('ተስፋዬ', 'Tes'); // true ✅
matchesName('አማኑኤል ፀጋዬ', 'Ama Tseg'); // true ✅
```
**That's it!** Now you can search for names regardless of whether they're typed in English or Amharic.
## Usage
### Basic Transliteration
```typescript
import { transliterateToAmharic } from 'amharic-name-search';
const amharicVariants = transliterateToAmharic('amanuel');
// Returns: ['አማኑኤል']
```
### Name Matching
```typescript
import { matchesName } from 'amharic-name-search';
// Match English query with Amharic name
matchesName('አማኑኤል', 'amanuel'); // true
matchesName('አማኑኤል ፀጋዬ', 'amanuel'); // true
// Match Amharic query with English name
matchesName('Amanuel', 'አማኑኤል'); // true
matchesName('Amanuel Tsegaye', 'አማኑኤል'); // true
// Romanization-aware matching (handles \"weird\" spellings)
matchesName('ተስፋዬ', 'tesfaye'); // true (standard)
matchesName('ተስፋዬ', 'tasfaye'); // true (non-standard)
matchesName('ሰላም', 'Sel'); // true (prefix)
matchesName('ዮሐንስ', 'Yoh'); // true (prefix)
```
### Search Query Expansion
```typescript
import { expandSearchQuery } from 'amharic-name-search';
const searchTerms = expandSearchQuery('amanuel');
// Returns: ['amanuel', 'አማኑኤል']
```
## API Reference
### `transliterateToAmharic(englishText, options?)`
Conver …