From c2042ef5d6fc21a35bedbc13d6f7284830cb0d66 Mon Sep 17 00:00:00 2001 From: Winston Sung Date: Wed, 20 Nov 2024 13:37:09 +0800 Subject: [PATCH] Update nan-latn-pehoeji-transliteration IME Bug: #815 Change-Id: I29a27904ad030b8c4a1f7c98f40c4e747cabd912 --- rules/nan/nan-latn-pehoeji-transliteration.js | 219 +++++++++++++++++- test/jquery.ime.test.fixtures.js | 2 +- 2 files changed, 217 insertions(+), 4 deletions(-) diff --git a/rules/nan/nan-latn-pehoeji-transliteration.js b/rules/nan/nan-latn-pehoeji-transliteration.js index 953c066e..154ca1f7 100644 --- a/rules/nan/nan-latn-pehoeji-transliteration.js +++ b/rules/nan/nan-latn-pehoeji-transliteration.js @@ -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' ], @@ -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' ], @@ -75,7 +75,7 @@ [ '(^|[^aeo])ng(6|~)', '$1ñg' ], [ '(^|[^aeo])ng(7|_)', '$1n̄g' ], [ 'n(g)?h(8|\')', 'n̍$1h' ], - [ '(o(a|á|à|â|ã|ā|a̍)i|(o|ó|ò|ô|õ|ō)a?|(o|o̍)h)nn', '$1$2ⁿ' ], + [ '(o(a|á|à|â|ã|ā|a̍)i|(o|ó|ò|ô|õ|ō)a?|(o|o̍)h)nn', '$1ⁿ' ], [ '(^|[^i])oa(h|iⁿ?|ng?|t)?1', '$1oa$2' ], [ '(^|[^i])o(ⁿ|aⁿ?|e|m|ng)?1', '$1o$2' ], [ '(^|[^i])oa(h|iⁿ?|ng?|t)?(2|\\\/)', '$1oá$2' ], @@ -92,14 +92,21 @@ [ '(^|[^i])o(ⁿ|aⁿ?|e|m|ng)?(7|_)', '$1ō$2' ], [ '(^|[^i])o(hⁿ?|k)(8|\')', '$1o̍$2' ], [ '(^|[^i])oeh8', '$1oe̍h' ], + [ 'ou', 'o͘' ], [ 'o͘1', 'o͘' ], [ 'o͘(2|\\\/)', 'ó͘' ], + [ 'óu', 'ó͘' ], [ 'o͘(3|\\\\)', 'ò͘' ], + [ 'òu', 'ò͘' ], [ 'o͘h4', 'o͘h' ], [ 'o͘(5|\\\^)', 'ô͘' ], + [ 'ôu', 'ô͘' ], [ 'o͘(6|~)', 'õ͘' ], + [ 'õu', 'õ͘' ], [ 'o͘(7|_)', 'ō͘' ], + [ 'ōu', 'ō͘' ], [ 'o͘h(8|\')', 'o̍͘h' ], + [ 'o̍u', 'o̍͘' ], [ '(^|[^ai])u(i|n)?1', '$1u$2' ], [ '(^|[^ai])u(i|n)?(2|\\\/)', '$1ú$2' ], [ '(^|[^ai])u(i|n)?(3|\\\\)', '$1ù$2' ], @@ -108,6 +115,212 @@ [ '(^|[^ai])u(i|n)?(6|~)', '$1ũ$2' ], [ '(^|[^ai])u(i|n)?(7|_)', '$1ū$2' ], [ '(^|[^ai])u(h|t)(8|\')', '$1u̍$2' ], +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', '$1Ō$2' ], + [ '(^|[^i])O(hⁿ?|k)(8|\')', '$1O̍$2' ], + [ '(^|[^i])Oeh8', '$1Oe̍h' ], + [ 'Ou', 'O͘' ], + [ 'O͘1', 'O͘' ], + [ 'O͘(2|\\\/)', 'Ó͘' ], + [ 'Óu', 'Ó͘' ], + [ 'O͘(3|\\\\)', 'Ò͘' ], + [ 'Òu', 'Ò͘' ], + [ 'O͘h4', 'O͘h' ], + [ 'O͘(5|\\\^)', 'Ô͘' ], + [ 'Ôu', 'Ô͘' ], + [ 'O͘(6|~)', 'Õ͘' ], + [ 'Õu', 'Õ͘' ], + [ 'O͘(7|_)', 'Ō͘' ], + [ 'Ō7', 'Ō͘' ], + [ 'O͘h(8|\')', 'O̍͘h' ], + [ 'O̍u', 'O̍͘' ], + [ '(^|[^ai])U(i|n)?1', '$1U$2' ], + [ '(^|[^ai])U(i|n)?(2|\\\/)', '$1Ú$2' ], + [ '(^|[^ai])U(i|n)?(3|\\\\)', '$1Ù$2' ], + [ '(^|[^ai])U(h|t)4', '$1U$2' ], + [ '(^|[^ai])U(i|n)?(5|\\\^)', '$1Û$2' ], + [ '(^|[^ai])U(i|n)?(6|~)', '$1Ũ$2' ], + [ '(^|[^ai])U(i|n)?(7|_)', '$1Ū$2' ], + [ '(^|[^ai])U(h|t)(8|\')', '$1U̍$2' ], + [ '((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' ], + [ '(^|[^IO])A(P|T|K|Hᴺ?|UH)4', '$1A$2' ], + [ '(^|[^IO])A(ᴺ|Iᴺ?|M|NG?|U)?(5|\\\^)', '$1Â$2' ], + [ '(^|[^IO])A(ᴺ|Iᴺ?|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ÕU', 'Õ͘' ], + [ 'O͘(7|_)', 'Ō͘' ], + [ 'Ō7', 'Ō͘' ], + [ 'O͘H(8|\')', 'O̍͘H' ], + [ 'O̍U', 'O̍͘' ], + [ '(^|[^AI])U(I|N)?1', '$1U$2' ], + [ '(^|[^AI])U(I|N)?(2|\\\/)', '$1Ú$2' ], + [ '(^|[^AI])U(I|N)?(3|\\\\)', '$1Ù$2' ], + [ '(^|[^AI])U(H|T)4', '$1U$2' ], + [ '(^|[^AI])U(I|N)?(5|\\\^)', '$1Û$2' ], + [ '(^|[^AI])U(I|N)?(6|~)', '$1Ũ$2' ], + [ '(^|[^AI])U(I|N)?(7|_)', '$1Ū$2' ], + [ '(^|[^AI])U(H|T)(8|\')', '$1U̍$2' ], ] }; diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 4699a57a..c296c8ce 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -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' } ] }, {