UNPKG

urdu-text-utils

Version:

Comprehensive Urdu NLP & text processing toolkit: normalization, Roman Urdu transliteration, stop words, script detection, digits, diacritics (aerab), sorting, search, and statistics. Zero dependencies, ESM + CJS.

26 lines (25 loc) • 1.27 kB
/** * Urdu -> Roman Urdu dictionary for the transliteration layer. * * Every entry here is a word the rule engine would otherwise get wrong, because * Urdu script omits short vowels: the rules see کتاب as k-t-aa-b and cannot know * that a reader supplies "kitaab". So the dictionary carries the vowels and the * rules only handle whatever falls through. * * Roman spellings follow the most common conventions in Pakistani usage * (`kaisay`, `bohat`, `mohabbat`) rather than a strict academic scheme, since the * output is meant for slugs, search keys and human readers. * * The reverse direction is derived from this map, so a duplicate Roman value * means the later Urdu word wins as the reverse target. Where that matters, the * preferred reverse form is pinned explicitly in `transliterate.ts` or `ROMAN_VARIANTS`. */ export declare const WORD_DICTIONARY: Record<string, string>; /** * Extra Roman spellings that map back to Urdu, for the reverse direction only. * * Roman Urdu has no standard orthography, so the same word arrives spelled many * ways. These are the variants common enough to be worth hard-coding, plus * disambiguations where two Urdu words share one Roman form. */ export declare const ROMAN_VARIANTS: Record<string, string>;