Skip to content

Add Nepali (npi-Deva) support - #259

Merged
juice500ml merged 4 commits into
dmort27:masterfrom
Sadhana-Panthi:add-nepali
Oct 8, 2026
Merged

juice500ml merged 4 commits into
dmort27:masterfrom
Sadhana-Panthi:add-nepali

Conversation

@Sadhana-Panthi

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Language addition: Nepali (npi-Deva).

Checklist

  • Have you added adequate tests on epitran/test?
  • Have you updated the language list in README.md?
  • Does it follow the - format?
  • Have you used IPA ɡ, not latin small letter g?

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-checked
against Wikipedia's Nepali phonology page where it lists forms
(अन्त ʌntʌ, हुन्छ ɦunt͡sʰʌ, तिर tiɾʌ, दुख dukʰʌ).

Sources of information for the rules

  • Native speaker judgment (primary, including for all decisions below)
  • Khatiwada, R. "Illustrations of the IPA: Nepali", Journal of the IPA —
    affricate inventory (t͡s/d͡z rather than t͡ʃ/d͡ʒ), vowel inventory
  • Wikipedia, "Nepali phonology" — inherent vowel as ʌ, schwa retention
  • Wikipedia, "Schwa deletion in Indo-Aryan languages" — Nepali retains
    medial schwa
  • nepalilanguage.org/pronounce — sibilant merger, क्ष/ज्ञ, ण behaviour

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:

  • Inherent vowel is ʌ, not ə
  • च छ ज झ are t͡s t͡sʰ d͡z d͡zʱ, not the t͡ʃ series
  • श, ष, स all merge to s
  • No long/short vowel contrast — hrasva and dirgha forms (i/ī, u/ū) are
    pronounced alike, so both map to i and u
  • Medial schwa is retained; Hindi deletes it
  • क्ष and ज्ञ are irregular, mapped as units
  • व is [b] word-initially but [w] intervocalically
  • ण् → n, while ण keeps ɳ elsewhere (बाण baɳ, गणित gʌɳit)

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:

  • Postpositions outside the lexical list lose their final schwa
  • Perso-Arabic loans with initial व get [b] (वकिल → bʌkil)
  • Words with free variation in ण (अरुण, किरण) get one fixed reading

Does this PR introduce a breaking change?

No. Only new files plus one README row; no existing language is touched.

@juice500ml juice500ml self-assigned this Oct 6, 2026

@juice500ml juice500ml left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@juice500ml
juice500ml merged commit 49e0409 into dmort27:master Oct 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants