diff --git a/rules/nqo/nqo-standard-qwerty.js b/rules/nqo/nqo-standard-qwerty.js new file mode 100644 index 00000000..fcc47bbb --- /dev/null +++ b/rules/nqo/nqo-standard-qwerty.js @@ -0,0 +1,93 @@ +( function ( $ ) { + 'use strict'; + + var nqoStandardQwerty = { + id: 'nqo-standard-qwerty', + name: "N'Ko standard qwerty", + description: "N'Ko standard qwerty", + date: '2019-04-26', + URL: 'https://github.com/wikimedia/jquery.ime', + author: 'Amir E. Aharoni', + license: 'GPLv3', + version: '1.0', + maxKeyLength: 1, + patterns: [ + [ '`', '߷' ], + [ '1', '߁' ], + [ '2', '߂' ], + [ '3', '߃' ], + [ '4', '߄' ], + [ '5', '߅' ], + [ '6', '߆' ], + [ '7', '߇' ], + [ '8', '߈' ], + [ '9', '߉' ], + [ '0', '߀' ], + + [ 'Q', 'ߩ' ], + [ 'W', 'ߨ' ], + [ 'Y', 'ߚ' ], + [ 'I', '÷' ], + [ 'O', '×' ], + [ 'P', 'ߪ' ], + + [ 'A', '߶' ], + [ 'D', '[' ], + [ 'F', ']' ], + [ 'G', '(' ], + [ 'H', ')' ], + [ 'J', 'ߺ' ], + [ 'L', '/' ], + + [ 'Z', '\u07F3' ], + [ 'X', '\u07F1' ], + [ 'C', '\u07ED' ], + [ 'V', '\u07EE' ], + [ 'B', '\u07F0' ], + [ 'N', '\u07EF' ], + [ 'M', '߸' ], // Comma + [ '<', 'ߑ' ], + [ '\\?', '؟' ], + + [ 'q', 'ߔ' ], + [ 'w', 'ߧ' ], + [ 'e', 'ߠ' ], + [ 'r', 'ߥ' ], + [ 't', 'ߦ' ], + [ 'y', 'ߙ' ], + [ 'u', 'ߗ' ], + [ 'i', 'ߜ' ], + [ 'o', 'ߢ' ], + [ 'p', 'ߡ' ], + [ '\\[', 'ߤ' ], + [ '\\]', 'ߒ' ], + + [ 'a', 'ߏ' ], + [ 's', 'ߎ' ], + [ 'd', 'ߍ' ], + [ 'f', 'ߌ' ], + [ 'g', 'ߋ' ], + [ 'h', 'ߊ' ], + [ 'k', 'ߝ' ], + [ 'j', 'ߖ' ], + [ 'k', 'ߞ' ], + [ 'l', 'ߣ' ], + [ 'm', 'ߟ' ], + [ ';', 'ߕ' ], + [ "'", 'ߓ' ], + + [ 'z', 'ߐ' ], + [ 'x', '\u07F2' ], + [ 'v', 'ߴ' ], + [ 'c', 'ߵ' ], + [ 'b', '\u07EC' ], + [ 'n', '\u07EB' ], + [ '!', '߹' ], + [ ',', 'ߛ' ], + [ '\\.', 'ߘ' ], + [ '/', 'ߞ' ] + ] + }; + + $.ime.register( nqoStandardQwerty ); +}( jQuery ) ); diff --git a/rules/nqo/nqo-transliteration.js b/rules/nqo/nqo-transliteration.js new file mode 100644 index 00000000..4ceb8c0b --- /dev/null +++ b/rules/nqo/nqo-transliteration.js @@ -0,0 +1,102 @@ +( function ( $ ) { + 'use strict'; + + var nqoTransliteration = { + id: 'nqo-transliteration', + name: "N'Ko transliteration", + description: "N'Ko transliteration", + date: '2019-04-26', + URL: 'http://github.com/wikimedia/jquery.ime', + author: 'Amir E. Aharoni', + license: 'GPLv3', + version: '1.0', + maxKeyLength: 3, + patterns: [ + // Sequences + [ 'ߣn', 'ߠ' ], // nn + [ 'ߢw', 'ߧ' ], // nyw + [ 'ߣy', 'ߢ' ], // ny + [ + 'ߖ\\/', + 'ߨ' + ], // j/ + [ + 'ߗ\\/', + 'ߩ' + ], // c/ + [ + 'ߙ\\/', + 'ߪ' + ], // r/ + [ '\u07F2\u07F2\\.', '߷' ], // ... + [ '\u07EB-', '-' ], // -- + [ '\u07EC~', '~' ], // ~~ + [ '\\\\\\?', '?' ], // \? + [ '\\?', '؟' ], + + // Unshifted + + [ '`', 'ߑ' ], + [ '1', '߁' ], + [ '2', '߂' ], + [ '3', '߃' ], + [ '4', '߄' ], + [ '5', '߅' ], + [ '6', '߆' ], + [ '7', '߇' ], + [ '8', '߈' ], + [ '9', '߉' ], + [ '0', '߀' ], + + [ 'w', 'ߥ' ], + [ 'e', 'ߍ' ], + [ 'r', 'ߙ' ], + [ 't', 'ߕ' ], + [ 'y', 'ߦ' ], + [ 'u', 'ߎ' ], + [ 'i', 'ߌ' ], + [ 'o', 'ߐ' ], + [ 'p', 'ߔ' ], + + [ 'a', 'ߊ' ], + [ 's', 'ߛ' ], + [ 'd', 'ߘ' ], + [ 'f', 'ߝ' ], + [ 'g', 'ߜ' ], + [ 'h', 'ߤ' ], + [ 'j', 'ߖ' ], + [ 'k', 'ߞ' ], + [ 'l', 'ߟ' ], + + [ 'c', 'ߗ' ], + [ 'b', 'ߓ' ], + [ 'n', 'ߣ' ], + [ 'm', 'ߡ' ], + + // Shifted + + [ '~', '\u07EC' ], + [ '!', '߹' ], + [ '#', '\u07F0' ], + [ '%', '\u07F3' ], + + [ 'E', 'ߋ' ], + [ 'R', 'ߚ' ], + [ 'O', 'ߏ' ], + [ 'N', 'ߒ' ], + [ '<', '\u07F1' ], + [ '>', '\u07EF' ], + [ '\u07EE\\.', '\u07ED' ], // ^. + [ '\\^', '\u07EE' ], // ^ + [ '߸\\/', 'ߺ' ], // ,/ + [ '\\.', '\u07F2' ], // Combining nasalization mark ("dot below") + [ ',', '߸' ], // Comma + [ '/', '߶' ], + [ "'", 'ߴ' ], // High tone apostrophe + [ '"', 'ߵ' ], // Low tone apostrophe + [ '-', '\u07EB' ] // Combining short high tone ("macron") + ] + }; + + $.ime.register( nqoTransliteration ); +}( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index fd312694..b39f016d 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -566,6 +566,14 @@ name: 'Tildemerkt transliterasjon', source: 'rules/nb/nb-tildeforms.js' }, + 'nqo-standard-qwerty': { + name: "N'Ko standard QWERTY", + source: 'rules/nqo/nqo-standard-qwerty.js' + }, + 'nqo-transliteration': { + name: "N'Ko transliteration", + source: 'rules/nqo/nqo-transliteration.js' + }, 'nso-tilde': { name: 'Sesotho sa Leboa tilde', source: 'rules/nso/nso-tilde.js' @@ -1182,6 +1190,10 @@ autonym: 'Norsk (nynorsk)', inputmethods: [ 'nb-normforms', 'nn-tildeforms' ] }, + nqo: { + autonym: 'ߒߞߏ', + inputmethods: [ 'nqo-standard-qwerty', 'nqo-transliteration' ] + }, nso: { autonym: 'Sesotho sa Leboa', inputmethods: [ 'nso-tilde' ] diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 6acc7c01..9c4bc5ed 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -3584,6 +3584,116 @@ var palochkaVariants = { { input: 'ujdkqdkygonf>', output: 'ကြိုဆိုပါသည်။', description: 'Myanmar mm3 ကြိုဆိုပါသည်။' } ] }, + { + description: "N'Ko standard QWERTY", + inputmethod: 'nqo-standard-qwerty', + tests: [ + { input: '!', output: '߹', description: "N'Ko standard QWERTY !" }, + { input: '%', output: '%', description: "N'Ko standard QWERTY %" }, + { input: '*', output: '*', description: "N'Ko standard QWERTY *" }, + { input: '(', output: '(', description: "N'Ko standard QWERTY (" }, + { input: ')', output: ')', description: "N'Ko standard QWERTY )" }, + { input: '_', output: '_', description: "N'Ko standard QWERTY _" }, + { input: '+', output: '+', description: "N'Ko standard QWERTY +" }, + { input: 'Q', output: 'ߩ', description: "N'Ko standard QWERTY Q" }, + { input: 'W', output: 'ߨ', description: "N'Ko standard QWERTY W" }, + { input: 'Y', output: 'ߚ', description: "N'Ko standard QWERTY Y" }, + { input: 'I', output: '÷', description: "N'Ko standard QWERTY I" }, + { input: 'O', output: '×', description: "N'Ko standard QWERTY O" }, + { input: 'P', output: 'ߪ', description: "N'Ko standard QWERTY P" }, + { input: 'A', output: '߶', description: "N'Ko standard QWERTY A" }, + { input: 'D', output: '[', description: "N'Ko standard QWERTY D" }, + { input: 'F', output: ']', description: "N'Ko standard QWERTY F" }, + { input: 'G', output: '(', description: "N'Ko standard QWERTY G" }, + { input: 'H', output: ')', description: "N'Ko standard QWERTY H" }, + { input: 'J', output: 'ߺ', description: "N'Ko standard QWERTY J" }, + { input: 'L', output: '/', description: "N'Ko standard QWERTY L" }, + { input: ':', output: ':', description: "N'Ko standard QWERTY :" }, + { input: '"', output: '"', description: "N'Ko standard QWERTY \"" }, + { input: 'uCsZmf/h', output: 'ߗ߭ߎ߳ߟߌߞߊ', description: "N'Ko standard QWERTY uCsZmf/h" }, + { input: 'ldX', output: 'ߣߍ߱', description: "N'Ko standard QWERTY ldX" }, + { input: "k.ab'hb;zV", output: 'ߝߘߏ߬ߓߊ߬ߕߐ߮', description: "N'Ko standard QWERTY k,ab'hb;zV" }, + { input: '.sB,hx', output: 'ߘߎ߰ߛߊ߲', description: "N'Ko standard QWERTY .sB,hx" }, + { input: 'wgn', output: 'ߧߋ߫', description: "N'Ko standard QWERTY wgn" }, + { input: ',aNya', output: 'ߛߏ߯ߙߏ', description: "N'Ko standard QWERTY ,aNya" }, + { input: ',g.rO', output: 'ߛߏ߯ߙߏ', description: "N'Ko transliteration sO>rO (testing Combining long high tone)" }, + { input: 'ne<', output: 'ߣߍ߱', description: "N'Ko transliteration ne< (testing Combining long rising tone)" }, + { input: 'du#sa.', output: 'ߘߎ߰ߛߊ߲', description: "N'Ko transliteration du#sa. (testing Combining long low tone)" }, + { input: 'c^.u%lika', output: 'ߗ߭ߎ߳ߟߌߞߊ', description: "N'Ko transliteration c^.u%lika (testing Combining double dot above)" }, + { input: ',/', output: 'ߺ', description: "N'Ko transliteration ,/ (testing Lajanyalan)" }, + { input: 'kO~n"a~lE~', output: 'ߞߏ߬ߣߵߊ߬ߟߋ߬', description: "N'Ko transliteration kO~n\"a~lE~ (testing low tone apostrophe)" }, + { input: 'k"a~', output: 'ߞߵߊ߬', description: "N'Ko transliteration k\"a~ (testing low tone apostrophe)" }, + { input: "d'a~", output: 'ߘߴߊ߬', description: "N'Ko transliteration d'a~ (testing high tone apostrophe)" }, + { input: '1234567890', output: '߁߂߃߄߅߆߇߈߉߀', description: "N'Ko transliteration 1234567890" }, + { input: '\\?', output: '?', description: "N'Ko transliteration \\?" }, + { input: '?', output: '؟', description: "N'Ko transliteration ?" }, + { input: '--', output: '-', description: "N'Ko transliteration --" }, + { input: '~~', output: '~', description: "N'Ko transliteration ~~" } + ] + }, { description: 'Northern Sotho tilde test', inputmethod: 'nso-tilde',