diff --git a/rules/hoc-latn/hoc-latn-semicolon.js b/rules/hoc-latn/hoc-latn-semicolon.js new file mode 100644 index 00000000..da590c48 --- /dev/null +++ b/rules/hoc-latn/hoc-latn-semicolon.js @@ -0,0 +1,228 @@ +( function ( $ ) { + 'use strict'; + + var hocLatnSemicolon = { + id: 'hoc-latn-semicolon', + name: 'Ho Latin semicolon', + description: 'Ho Latin semicolon keyboard', + date: '2026-07-31', + URL: 'https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:UniversalLanguageSelector/Input_methods/hoc-latn-semicolon', + author: 'Mangu Purty', + license: 'GPLv3', + version: '1.0', + maxKeyLength: 4, + patterns: [ + + // uppercase + [ 'Z;', 'T́' ], + [ 'K;', 'Ḱ' ], + [ 'C;', 'Ć' ], + [ 'P;', 'Ṕ' ], + [ 'W;', 'Ṕ' ], + + [ 'Ḱ;', 'K' ], + [ 'Ć;', 'C' ], + [ 'T́;', 'Z' ], + [ 'Ṕ;', 'P' ], + + [ 'T;', 'Ṭ' ], + [ 'D;', 'Ḍ' ], + [ 'R;', 'Ṛ' ], + [ 'T\\.\\.', 'Ṭ' ], + [ 'D\\.\\.', 'Ḍ' ], + [ 'R\\.\\.', 'Ṛ' ], + + [ 'Ṭ;', 'T' ], + [ 'Ḍ;', 'D' ], + [ 'Ṛ;', 'R' ], + + [ 'N;', 'Ṅ' ], + [ 'J;', 'Ń' ], + + [ 'Ṅ;', 'N' ], + [ 'Ń;', 'J' ], + + [ 'A;', 'Á' ], + [ 'Á;', 'Ã' ], + [ 'Ã;', 'Ä' ], + [ 'Ä;', 'À' ], + [ 'À;', 'Â' ], + [ 'Â;', 'A' ], + + [ 'A\u0060', 'À' ], // u0060 = ` + [ 'A\u007E', 'Ã' ], // u007E = ~ + [ 'A\\.\\.', 'Ạ' ], + [ 'Ạ\\.\\.', 'Ä' ], + [ 'A\\^', 'Â' ], + [ 'À\u0060', 'Á' ], + + [ 'E;', 'É' ], + [ 'É;', 'Ẽ' ], + [ 'Ẽ;', 'Ë' ], + [ 'Ë;', 'È' ], + [ 'È;', 'Ê' ], + [ 'Ê;', 'E' ], + + [ 'E\u0060', 'È' ], + [ 'E\u007E', 'Ẽ' ], + [ 'E\\.\\.', 'Ẹ' ], + [ 'Ẹ\\.\\.', 'Ë' ], + [ 'E\\^', 'Ê' ], + [ 'È\u0060', 'É' ], + + [ 'I;', 'Í' ], + [ 'Í;', 'Ĩ' ], + [ 'Ĩ;', 'Ï' ], + [ 'Ï;', 'Ì' ], + [ 'Ì;', 'Î' ], + [ 'Î;', 'I' ], + + [ 'I\u0060', 'Ì' ], + [ 'I\u007E', 'Ĩ' ], + [ 'I\\.\\.', 'Ï' ], + [ 'I\\^', 'Î' ], + [ 'Ì\u0060', 'Í' ], + + [ 'O;', 'Ó' ], + [ 'Ó;', 'Õ' ], + [ 'Õ;', 'Ö' ], + [ 'Ö;', 'Ò' ], + [ 'Ò;', 'Ô' ], + [ 'Ô;', 'O' ], + + [ 'O\u0060', 'Ò' ], + [ 'O\u007E', 'Õ' ], + [ 'O\\.\\.', 'Ọ' ], + [ 'Ọ\\.\\.', 'Ö' ], + [ 'O\\^', 'Ô' ], + [ 'Ò\u0060', 'Ó' ], + + [ 'U;', 'Ú' ], + [ 'Ú;', 'Ũ' ], + [ 'Ũ;', 'Ü' ], + [ 'Ü;', 'Ù' ], + [ 'Ù;', 'Û' ], + [ 'Û;', 'U' ], + + [ 'U\u0060', 'Ù' ], + [ 'U\u007E', 'Ũ' ], + [ 'U\\.\\.', 'Ü' ], + [ 'U\\^', 'Û' ], + [ 'Ù\u0060', 'Ú' ], + + // lowercase + + [ 'z;', 't́' ], + [ 'k;', 'ḱ' ], + [ 'c;', 'ć' ], + [ 'p;', 'ṕ' ], + [ 'w;', 'ṕ' ], + + [ 'ḱ;', 'k' ], + [ 'ć;', 'c' ], + [ 't́;', 'z' ], + [ 'ṕ;', 'p' ], + + [ 't;', 'ṭ' ], + [ 'd;', 'ḍ' ], + [ 'r;', 'ṛ' ], + [ 't\\.\\.', 'ṭ' ], + [ 'd\\.\\.', 'ḍ' ], + [ 'r\\.\\.', 'ṛ' ], + + [ 'ṭ;', 't' ], + [ 'ḍ;', 'd' ], + [ 'ṛ;', 'r' ], + + [ 'n;', 'ṅ' ], + [ 'j;', 'ń' ], + + [ 'ṅ;', 'n' ], + [ 'ń;', 'j' ], + + [ 'a;', 'á' ], + [ 'á;', 'ã' ], + [ 'ã;', 'ä' ], + [ 'ä;', 'à' ], + [ 'à;', 'â' ], + [ 'â;', 'a' ], + + [ 'a\u0060', 'à' ], // u0060 = ` + [ 'a\u007e', 'ã' ], // u007e = ~ + [ 'a\\.\\.', 'ạ' ], + [ 'ạ\\.\\.', 'ä' ], + [ 'a\\^', 'â' ], + [ 'à\u0060', 'á' ], + + [ 'e;', 'é' ], + [ 'é;', 'ẽ' ], + [ 'ẽ;', 'ë' ], + [ 'ë;', 'è' ], + [ 'è;', 'ê' ], + [ 'ê;', 'e' ], + + [ 'e\u0060', 'è' ], + [ 'e\u007e', 'ẽ' ], + [ 'e\\.\\.', 'ẹ' ], + [ 'e\\^', 'ê' ], + [ 'è\u0060', 'é' ], + + [ 'i;', 'í' ], + [ 'í;', 'ĩ' ], + [ 'ĩ;', 'ï' ], + [ 'ï;', 'ì' ], + [ 'ì;', 'î' ], + [ 'î;', 'i' ], + + [ 'i\u0060', 'ì' ], + [ 'i\u007e', 'ĩ' ], + [ 'i\\.\\.', 'ï' ], + [ 'i\\^', 'î' ], + [ 'ì\u0060', 'í' ], + + [ 'o;', 'ó' ], + [ 'ó;', 'õ' ], + [ 'õ;', 'ö' ], + [ 'ö;', 'ò' ], + [ 'ò;', 'ô' ], + [ 'ô;', 'o' ], + + [ 'o\u0060', 'ò' ], + [ 'o\u007e', 'õ' ], + [ 'o\\.\\.', 'ọ' ], + [ 'ọ\\.\\.', 'ö' ], + [ 'o\\^', 'ô' ], + [ 'ò\u0060', 'ó' ], + + [ 'u;', 'ú' ], + [ 'ú;', 'ũ' ], + [ 'ũ;', 'ü' ], + [ 'ü;', 'ù' ], + [ 'ù;', 'û' ], + [ 'û;', 'u' ], + + [ 'u\u0060', 'ù' ], + [ 'u\u007e', 'ũ' ], + [ 'u\\.\\.', 'ü' ], + [ 'u\\^', 'û' ], + [ 'ù\u0060', 'ú' ], + + // punctuation + [ '\u003C', '‹' ], // u003C = < + [ '\u003E', '›' ], // u003E = > + [ '››', '»' ], + [ '‹‹', '«' ], + + [ '\\\\;', ';' ], + [ '\\\\\u007E', '\u007E' ], // \u007E = ~ + [ '\\\\\u0060', '\u0060' ], // \u0060 = ` + [ '\\\\\\^', '\^' ], + [ '\\\\‹', '\u003C' ], // \u003C = < + [ '\\\\›', '\u003E' ], // \u003E = > + [ '\\.;', '·' ], + [ '([A-Za-zẠẸỌạẹọ])\\\\\\.\\.', '$1\.\.' ] + ] + }; + + $.ime.register( hocLatnSemicolon ); +}( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index f6e97abe..64188cc0 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -420,6 +420,10 @@ name: 'लिप्यंतरण', source: 'rules/hi/hi-transliteration.js' }, + 'hoc-latn-semicolon': { + name: 'Ho Latin Semicolon', + source: 'rules/hoc-latn/hoc-latn-semicolon.js' + }, 'hoc-latn-tilde': { name: 'Ho Latin Tilde', source: 'rules/hoc-latn/hoc-latn-tilde.js' @@ -1440,7 +1444,7 @@ }, 'hoc-latn': { autonym: 'Ho', - inputmethods: [ 'hoc-latn-tilde' ] + inputmethods: [ 'hoc-latn-tilde', 'hoc-latn-semicolon' ] }, hr: { autonym: 'Hrvatski', diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 79c24dc4..9948e2f7 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -1,4 +1,4 @@ -// Variables for Cyrillic with palochka transliteration tests. +// Variables for Cyrillic with palochka transliteration tests. // All the characters are very similar in appearance, // so it's better to give them names to avoid confusion. // eslint-disable-next-line no-implicit-globals @@ -2432,6 +2432,38 @@ var palochkaVariants = { { input: '0', output: '०', description: '0 for ० translitration' } ] }, + { + description: 'Ho Latin Semicolon test', + inputmethod: 'hoc-latn-semicolon', + tests: [ + { input: 'I;m pi..z; a\\; Sarak; a\\... a\\^', output: 'Ím pït́ a; Saraḱ a... a^', description: 'I;m pi..z; a\\; Sarak; a...' }, + { input: 'K;C;Z;P;k;c;z;p;', output: 'ḰĆT́Ṕḱćt́ṕ', description: 'Ho consonants K;C;T;P;k;c;z;p;' }, + { input: 'W;w;', output: 'Ṕṕ', description: 'Ho consonants W;w;' }, + { input: 'T;D;R;t;d;r;', output: 'ṬḌṚṭḍṛ', description: 'Ho consonants T;D;R;t;d;r;' }, + { input: 'N;J;n;j;', output: 'ṄŃṅń', description: 'Ho consonants N;J;n;j;' }, + { input: 'A;E;I;O;U;a;e;i;o;u;', output: 'ÁÉÍÓÚáéíóú', description: 'Ho vowels acute' }, + { input: 'Á;É;Í;Ó;Ú;á;é;í;ó;ú;', output: 'ÃẼĨÕŨãẽĩõũ', description: 'Ho vowels tilde' }, + { input: 'Ã;Ẽ;Ĩ;Õ;Ũ;ã;ẽ;ĩ;õ;ũ;', output: 'ÄËÏÖÜäëïöü', description: 'Ho vowels dieresis' }, + { input: 'Ä;Ë;Ï;Ö;Ü;ä;ë;ï;ö;ü;', output: 'ÀÈÌÒÙàèìòù', description: 'Ho vowels grave' }, + { input: 'À;È;Ì;Ò;Ù;à;è;ì;ò;ù;', output: 'ÂÊÎÔÛâêîôû', description: 'Ho vowels circumflex' }, + { input: 'A`E`I`O`U`a`e`i`o`u`', output: 'ÀÈÌÒÙàèìòù', description: 'Ho vowels A`E`I`O`U`a`e`i`o`u`' }, + { input: 'A~E~I~O~U~a~e~i~o~u~', output: 'ÃẼĨÕŨãẽĩõũ', description: 'Ho vowels A~E~I~O~U~a~e~i~o~u~' }, + { input: 'A\u005EE\u005EI\u005EO\u005EU\u005Ea\u005Ee\u005Ei\u005Eo\u005Eu\u005E', output: 'ÂÊÎÔÛâêîôû', description: 'Ho vowels A^E^I^O^U^a^e^i^o^u^' }, + { input: 'A..E..I..O..U..a..e..i..o..u..', output: 'ẠẸÏỌÜạẹïọü', description: 'Ho vowels A..E..I..O..U..a..e..i..o..u..' }, + { input: '.;', output: '·', description: 'Ho punctuation middle dot' }, + { input: '\\;', output: ';', description: 'Ho punctuation \u005C;' }, + { input: '<>‹‹››', output: '‹›«»', description: 'Ho quotes <><<››' }, + { input: 'Maz;kamdak;', output: 'Mat́kamdaḱ', description: 'Maz;kamdak;' }, + { input: 'Ṕ;', output: 'P', description: 'Ho consonants Ḱ reverse' }, + { input: 'Ṭ; Ḍ; Ṛ;', output: 'T D R', description: 'Ho consonants TDR reverse' }, + { input: 'T..D..R..', output: 'ṬḌṚ', description: 'Ho consonants T..D..R..' }, + { input: 'Ṅ;Ń;', output: 'NJ', description: 'Ho consonants NJ reverse' }, + { input: '\\~\\`\\^\\‹\\›\\;', output: '~`^<>;', description: 'Ho punctuations \u005C~\u005C`\u005C^\u005C<\u005C>\u005C;' }, + { input: 'a\u005C\u005E', output: 'a\u005E', description: 'Ho a\u005C\u005E' }, + { input: 'Ạ..Ẹ..Ï..Ọ..Ü..', output: 'ÄËÏ..ÖÜ..', description: 'Ho vowels Ạ..Ẹ..Ï..Ọ..Ü..' }, + { input: 'Â;Ê;Î;Ô;Û;', output: 'AEIOU', description: 'Ho vowels reverse' } + ] + }, { description: 'Ho Latin Tilde test', inputmethod: 'hoc-latn-tilde', @@ -22516,4 +22548,4 @@ var palochkaVariants = { { input: 'wang3', output: 'wǎng', description: 'Mandarin Hanyu Pinyin wǎng' } ] } -]; +]; \ No newline at end of file