Skip to content

Commit

Permalink
Add N'Ko keyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
amire80 authored and kartikm committed May 21, 2019
1 parent 7fd5c64 commit d660b6e
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 0 deletions.
93 changes: 93 additions & 0 deletions rules/nqo/nqo-standard-qwerty.js
Original file line number Diff line number Diff line change
@@ -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 ) );
102 changes: 102 additions & 0 deletions rules/nqo/nqo-transliteration.js
Original file line number Diff line number Diff line change
@@ -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 ) );
12 changes: 12 additions & 0 deletions src/jquery.ime.inputmethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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' ]
Expand Down
110 changes: 110 additions & 0 deletions test/jquery.ime.test.fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<lgf', output: 'ߛߋߘߑߣߋߌ', description: "N'Ko standard QWERTY ,g.<lgf" },
{ 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: 'e', output: 'ߠ', description: "N'Ko standard QWERTY e" },
{ input: 'r', output: 'ߥ', description: "N'Ko standard QWERTY r" },
{ input: 't', output: 'ߦ', description: "N'Ko standard QWERTY t" },
{ input: 'y', output: 'ߙ', description: "N'Ko standard QWERTY y" },
{ input: 'u', output: 'ߗ', description: "N'Ko standard QWERTY u" },
{ 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: '[', output: 'ߤ', description: "N'Ko standard QWERTY [" },
{ input: ']', output: 'ߒ', description: "N'Ko standard QWERTY ]" },
{ input: 'a', output: 'ߏ', description: "N'Ko standard QWERTY a" },
{ input: 's', output: 'ߎ', description: "N'Ko standard QWERTY s" },
{ 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: 'k', output: 'ߝ', description: "N'Ko standard QWERTY k" },
{ input: 'l', output: 'ߣ', description: "N'Ko standard QWERTY l" },
{ input: ';', output: 'ߕ', description: "N'Ko standard QWERTY ;" },
{ input: "'", output: 'ߓ', description: "N'Ko standard QWERTY '" },
{ input: 'z', output: 'ߐ', description: "N'Ko standard QWERTY z" },
{ input: 'ophmzxldx', output: 'ߢߡߊߟߐ߲ߣߍ߲', description: "N'Ko standard QWERTY ophmzxldx (testing dot below)" },
{ input: '/chb', output: 'ߞߵߊ߬', description: "N'Ko standard QWERTY /chb (testing low tone apostrophe and short low tone)" },
{ input: '.vhb', output: 'ߘߴߊ߬', description: "N'Ko standard QWERTY .vhb (testing high tone apostrophe and short low tone)" },
{ input: 'kan', output: 'ߝߏ߫', description: "N'Ko standard QWERTY kan (testing short high tone)" },
{ input: 'm', output: 'ߟ', description: "N'Ko standard QWERTY m" },
{ input: ',', output: 'ߛ', description: "N'Ko standard QWERTY ," },
{ input: '.', output: 'ߘ', description: "N'Ko standard QWERTY ." },
{ input: '/', output: 'ߞ', description: "N'Ko standard QWERTY /" }
]
},
{
description: "N'Ko transliteration",
inputmethod: 'nqo-transliteration',
tests: [
{ input: 'E', output: 'ߋ', description: "N'Ko transliteration E" },
{ input: 'e', output: 'ߍ', description: "N'Ko transliteration e" },
{ input: 'O', output: 'ߏ', description: "N'Ko transliteration O" },
{ input: 'o', output: 'ߐ', description: "N'Ko transliteration o" },
{ input: 'R', output: 'ߚ', description: "N'Ko transliteration R" },
{ input: 'r', output: 'ߙ', description: "N'Ko transliteration r" },
{ input: 'nn', output: 'ߠ', description: "N'Ko transliteration nn" },
{ input: 'ny', output: 'ߢ', description: "N'Ko transliteration ny" },
{ input: 'nyw', output: 'ߧ', description: "N'Ko transliteration nyw" },
{ input: 'sEd`nEi', output: 'ߛߋߘߑߣߋߌ', description: "N'Ko transliteration sEd`nEi (testing dagbasinna)" },
{ input: 'NkO', output: 'ߒߞߏ', description: "N'Ko transliteration NkO" },
{ input: 'nnu~', output: 'ߠߎ߬', description: "N'Ko transliteration nnu~" },
{ input: 'nymalo.ne.', output: 'ߢߡߊߟߐ߲ߣߍ߲', description: "N'Ko transliteration nymalo.ne." },
{ input: 'nywE-', output: 'ߧߋ߫', description: "N'Ko transliteration nywE-" },
{ input: 'j/', output: 'ߨ', description: "N'Ko transliteration j/" },
{ input: 'c/', output: 'ߩ', description: "N'Ko transliteration c/" },
{ input: 'r/', output: 'ߪ', description: "N'Ko transliteration r/" },
{ input: 'to^.', output: 'ߕߐ߭', description: "N'Ko transliteration to^. (testing Combining short rising tone)" },
{ input: 'fdO~ba~to^', output: 'ߝߘߏ߬ߓߊ߬ߕߐ߮', description: "N'Ko transliteration (testing Combining short low tone and Combining long descending tone)" },
{ input: '/', output: '߶', description: "N'Ko transliteration /" },
{ input: '...', output: '߷', description: "N'Ko transliteration ..." },
{ input: ',', output: '߸', description: "N'Ko transliteration ," },
{ input: '!', output: '߹', description: "N'Ko transliteration !" },
{ input: 'sO>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',
Expand Down

0 comments on commit d660b6e

Please sign in to comment.