Skip to content

Commit

Permalink
Update nan-latn-pehoeji-transliteration IME
Browse files Browse the repository at this point in the history
Bug: wikimedia#815
Change-Id: I29a27904ad030b8c4a1f7c98f40c4e747cabd912
  • Loading branch information
winstonsung committed Nov 20, 2024
1 parent 805d7d7 commit 53d319d
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 4 deletions.
105 changes: 102 additions & 3 deletions rules/nan/nan-latn-pehoeji-transliteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
version: '1.0',
maxKeyLength: 4,
patterns: [
[ '((a|á|à|â|ã|ā|a̍)[hi]?)nn', '$1ⁿ' ],
[ '((a|á|à|â|ã|ā)i?|(a|a̍)h)nn', '$1ⁿ' ],
[ '(^|[^io])a(ⁿ|iⁿ?|m|ng?|u)?1', '$1a$2' ],
[ '(^|[^io])a(ⁿ|iⁿ?|m|ng?|u)?(2|\\\/)', '$1á$2' ],
[ '(^|[^io])a(ⁿ|iⁿ?|m|ng?|u)?(3|\\\\)', '$1à$2' ],
Expand All @@ -21,7 +21,7 @@
[ '(^|[^io])a(ⁿ|iⁿ?|m|ng?|u)?(6|~)', '$1ã$2' ],
[ '(^|[^io])a(ⁿ|iⁿ?|m|ng?|u)?(7|_)', '$1ā$2' ],
[ '(^|[^io])a(p|t|k|hⁿ?|uh)(8|\')', '$1a̍$2' ],
[ '(e|é|è|eh|ê|ẽ|ē|e̍h)?nn', '$1$2ⁿ' ],
[ '(e|é|è|eh|ê|ẽ|ē|e̍h)?nn', '$1ⁿ' ],
[ '(^|[^o])e(ⁿ|ng)1', '$1e$2' ],
[ '(^|[^o])e(ⁿ|ng)(2|\\\/)', '$1é$2' ],
[ '(^|[^o])e(ⁿ|ng)(3|\\\\)', '$1è$2' ],
Expand Down Expand Up @@ -75,7 +75,7 @@
[ '(^|[^aeo])ng(6|~)', '$1ñg' ],
[ '(^|[^aeo])ng(7|_)', '$1n̄g' ],
[ 'n(g)?h(8|\')', 'n̍$1h' ],
[ '(o(a|á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'o͘' ],
[ 'o͘1', 'o͘' ],
[ 'o͘(2|\\\/)', 'ó͘' ],
[ 'o͘(3|\\\\)', 'ò͘' ],
Expand Down
2 changes: 1 addition & 1 deletion test/jquery.ime.test.fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -5157,7 +5157,7 @@ var palochkaVariants = {
{ input: 'ap\'', output: 'a̍p', description: 'Hokkien Pe̍h-ōe-jī a̍p' },
{ input: 'khoann3', output: 'khòaⁿ', description: 'Hokkien Pe̍h-ōe-jī khòaⁿ' },
{ input: 'khoai3', output: 'khoài', description: 'Hokkien Pe̍h-ōe-jī khoài' },
{ input: 'kong3', output: 'kòng', description: 'Hokkien Pe̍h-ōe-jī kòng' }
{ input: 'ouh8', output: 'o̍͘h', description: 'Hokkien Pe̍h-ōe-jī o̍͘h' }
]
},
{
Expand Down

0 comments on commit 53d319d

Please sign in to comment.