Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for Marathi diphthong grapheme -> long vowel phoneme rules. #511

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions nisaba/scripts/natural_translit/brahmic/g2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def iso_to_txn() -> pyn.Fst:

# Vowels

# TODO: Convert this constant to a function where duration and diphthong
# context are passed as arguments, and remove the recovery rule.
# The current rule rewrites all /a/ to /ə/ including the diphthongs like /ai/,
# and recovers long a with /ə:/ -> /a:/ but not the diphthongs.
A_TO_EC = (
rw.rewrite(ph.A, ph.EC) @
rw.rewrite(ph.EC + ph.DURH, ph.A + ph.DURH)
Expand Down
10 changes: 10 additions & 0 deletions nisaba/scripts/natural_translit/g2p/testdata/mr_iso_ipa.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ rewrite {
input: "siddʰēgavhāṇa"
output: "sid̪d̪ʰeːɡəʋʰaːɳ"
}
rewrite {
rule: "ISO_TO_IPA"
input: "aisā"
output: "ɛːsaː"
}
rewrite {
rule: "ISO_TO_IPA"
input: "kannauja"
output: "kən̪n̪ɔːd͡ʒ"
}
Loading