Repository navigation
Add Nepali (npi-Deva) support - #259
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Language addition: Nepali (npi-Deva).
Checklist
Sources of information for the test samples
I'm a native Nepali speaker. Every word/IPA pair in
epitran/test/test_nepali.py(25 pairs) is my own judgment, cross-checkedagainst Wikipedia's Nepali phonology page where it lists forms
(अन्त ʌntʌ, हुन्छ ɦunt͡sʰʌ, तिर tiɾʌ, दुख dukʰʌ).
Sources of information for the rules
affricate inventory (t͡s/d͡z rather than t͡ʃ/d͡ʒ), vowel inventory
medial schwa
Draft files were assembled with AI assistance from the published sources
above and from hin-Deva as a structural template; every phonological
decision was then verified or corrected by me as a native speaker.
What is the current behavior?
Nepali is unsupported. It is the only major Devanagari language missing
from Epitran — hin-Deva, mar-Deva and bho-Deva are present. hin-Deva is
not a usable substitute; the differences are systematic:
pronounced alike, so both map to i and u
What is the new behavior (if this is a feature change)?
epitran.Epitran('npi-Deva')transliterates Nepali Devanagari to IPA.Adds
epitran/data/map/npi-Deva.csv,epitran/data/post/npi-Deva.txt,epitran/test/test_nepali.py, and a README table row.One design decision worth review: Nepali final-schwa retention is
conditioned grammatically, not phonologically. Nouns delete it
(काम kam, घर gʱʌɾ, ज्ञान gjan); postpositions (तिर tiɾʌ, बाट baʈʌ), the
adverb अब, and a few nouns (दुख, सुख) retain it. Verb forms retain it too,
but those come out right for free — they end in clusters that block the
deletion rule.
Since part of speech isn't recoverable from the orthography, the closed
class is handled with lexical entries in the map that emit a protected
symbol (A), restored to ʌ in the postprocessor after the deletion rule.
Suffixed forms still behave: दुखी dukʰi, बाटो baʈo, तिर्नु tiɾnu. Happy to
rework this if you'd prefer a different mechanism, or to split it into an
npi-Deva-red variant.
Nukta letters (क़ ख़ ग़ ज़ फ़ ड़ ढ़) are included despite not being standard
Nepali orthography. They turn up in borrowed spellings, and without
entries, the bare nukta passes through into the output (ज़रुरी →
d͡zʌ़ɾuɾi) and blocks schwa deletion. Most collapse to their plain
counterparts; ज़ and फ़ keep z and f.
Known limitations:
Does this PR introduce a breaking change?
No. Only new files plus one README row; no existing language is touched.