From 22407cf9928b3b5847865f5a5fa8b8628f61a1ed Mon Sep 17 00:00:00 2001 From: Amir Aharoni Date: Fri, 29 Mar 2019 07:42:28 -0700 Subject: [PATCH] Add a Kabyle tilde keyboard --- rules/kab/kab-tilde.js | 41 +++++++++++++++++++++++++++++ src/jquery.ime.inputmethods.js | 12 ++++++--- test/jquery.ime.test.fixtures.js | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 rules/kab/kab-tilde.js diff --git a/rules/kab/kab-tilde.js b/rules/kab/kab-tilde.js new file mode 100644 index 00000000..381af930 --- /dev/null +++ b/rules/kab/kab-tilde.js @@ -0,0 +1,41 @@ +( function ( $ ) { + 'use strict'; + + var kabTilde = { + id: 'kab-tilde', + name: 'kab-tilde', + description: 'Kabyle Latin tilde keyboard', + date: '2018-11-30', + URL: 'https://github.com/wikimedia/jquery.ime', + author: 'Amir E. Aharoni', + license: 'GPLv3', + version: '1.0', + patterns: [ + [ '~C', 'C\u030C' ], // C with combining caron + [ '~c', 'c\u030C' ], // c with combining caron + [ '~D', 'D\u0323' ], // D with combining dot below + [ '~d', 'd\u0323' ], // d with combining dot below + [ '~E', 'Ɛ' ], + [ '~e', 'ɛ' ], + [ '~G', 'G\u030C' ], // G with combining caron + [ '~g', 'g\u030C' ], // g with combining caron + [ '~Y', 'Ɣ' ], + [ '~y', 'ɣ' ], + [ '~H', 'H\u0323' ], // H with combining dot below + [ '~h', 'h\u0323' ], // h with combining dot below + // ~R is not provided to avoided confusion between caron and dot below + [ '~S', 'S\u0323' ], // S with combining dot below + [ '~s', 's\u0323' ], // s with combining dot below + [ '~T', 'T\u0323' ], // T with combining dot below + [ '~t', 't\u0323' ], // t with combining dot below + [ '~Z', 'Z\u0323' ], // Z with combining dot below + [ '~z', 'z\u0323' ], // z with combining dot below + [ '~w', 'ʷ' ], + [ '~v', '\u030C' ], // Combining caron + [ '~\\.', '\u0323' ], // Combining dot below + [ '~,', '\u0327' ] // Combining cedilla + ] + }; + + $.ime.register( kabTilde ); +}( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index 72e9d69b..7089f3c4 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -336,6 +336,10 @@ name: 'ტრანსლიტერაცია', source: 'rules/ka/ka-transliteration.js' }, + 'kab-tilde': { + name: 'Taqbaylit Alatin tilde', + source: 'rules/kab/kab-tilde.js' + }, 'kbp-tilde': { name: 'Kabɩyɛ tilde', source: 'rules/kbp/kbp-tilde.js' @@ -1014,6 +1018,10 @@ autonym: 'ქართული ენა', inputmethods: [ 'ka-transliteration', 'ka-kbd' ] }, + kab: { + autonym: 'Taqbaylit / ⵜⴰⵇⴱⴰⵢⵍⵉⵜ', + inputmethods: [ 'kab-tilde', 'ber-tfng' ] + }, kbd: { autonym: 'адыгэбзэ (къэбэрдеибзэ)', inputmethods: [ 'cyrl-palochka' ] @@ -1046,10 +1054,6 @@ autonym: 'Кыргыз', inputmethods: [ 'ky-cyrl-alt' ] }, - kab: { - autonym: 'ⵜⴰⵇⴱⴰⵢⵍⵉⵜ', - inputmethods: [ 'ber-tfng' ] - }, ku: { autonym: 'Kurdî', inputmethods: [ 'ku-h', 'ku-tr' ] diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index a57e5e2e..e9ac07e4 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -2058,6 +2058,51 @@ var palochkaVariants = { { input: 'WRTSJZC`~', output: 'ჭღთშჟძჩ„“', description: 'WRTSJZC`~ in Georgian' } ] }, + { + description: 'Kabyle tilde test', + inputmethod: 'kab-tilde', + tests: [ + { input: '~C', output: 'Č', description: 'Kabyle tilde Č direct' }, + { input: '~c', output: 'č', description: 'Kabyle tilde č direct' }, + { input: 'C~v', output: 'Č', description: 'Kabyle tilde Č combining' }, + { input: 'c~v', output: 'č', description: 'Kabyle tilde č combining' }, + { input: '~D', output: 'Ḍ', description: 'Kabyle tilde Ḍ direct' }, + { input: '~d', output: 'ḍ', description: 'Kabyle tilde ḍ direct' }, + { input: 'D~.', output: 'Ḍ', description: 'Kabyle tilde Ḍ combining' }, + { input: 'd~.', output: 'ḍ', description: 'Kabyle tilde ḍ combining' }, + { input: '~E', output: 'Ɛ', description: 'Kabyle tilde Ɛ' }, + { input: '~e', output: 'ɛ', description: 'Kabyle tilde ɛ' }, + { input: '~G', output: 'Ǧ', description: 'Kabyle tilde Ǧ direct' }, + { input: '~g', output: 'ǧ', description: 'Kabyle tilde ǧ direct' }, + { input: 'G~v', output: 'Ǧ', description: 'Kabyle tilde Ǧ combining' }, + { input: 'g~v', output: 'ǧ', description: 'Kabyle tilde ǧ combining' }, + { input: '~Y', output: 'Ɣ', description: 'Kabyle tilde Ɣ' }, + { input: '~y', output: 'ɣ', description: 'Kabyle tilde ɣ' }, + { input: '~H', output: 'Ḥ', description: 'Kabyle tilde Ḥ direct' }, + { input: '~h', output: 'ḥ', description: 'Kabyle tilde ḥ direct' }, + { input: 'H~.', output: 'Ḥ', description: 'Kabyle tilde Ḥ combining' }, + { input: 'h~.', output: 'ḥ', description: 'Kabyle tilde ḥ combining' }, + { input: '~R', output: '~R', description: 'Kabyle tilde ~R - no direct' }, + { input: '~r', output: '~r', description: 'Kabyle tilde ~r - no direct' }, + { input: '~S', output: 'Ṣ', description: 'Kabyle tilde Ṣ direct' }, + { input: '~s', output: 'ṣ', description: 'Kabyle tilde ṣ direct' }, + { input: 'S~.', output: 'Ṣ', description: 'Kabyle tilde Ṣ combining' }, + { input: 's~.', output: 'ṣ', description: 'Kabyle tilde ṣ combining' }, + { input: '~T', output: 'Ṭ', description: 'Kabyle tilde Ṭ direct' }, + { input: '~t', output: 'ṭ', description: 'Kabyle tilde ṭ direct' }, + { input: 'T~.', output: 'Ṭ', description: 'Kabyle tilde Ṭ combining' }, + { input: 't~.', output: 'ṭ', description: 'Kabyle tilde ṭ combining' }, + { input: 'T~,', output: 'Ţ', description: 'Kabyle tilde Ţ combining' }, + { input: 't~,', output: 'ţ', description: 'Kabyle tilde ţ combining' }, + { input: '~Z', output: 'Ẓ', description: 'Kabyle tilde Ẓ direct' }, + { input: '~z', output: 'ẓ', description: 'Kabyle tilde ẓ direct' }, + { input: 'Z~.', output: 'Ẓ', description: 'Kabyle tilde Ẓ combining' }, + { input: 'z~.', output: 'ẓ', description: 'Kabyle tilde ẓ combining' }, + { input: 'Z~,', output: 'Z̧', description: 'Kabyle tilde Z̧ combining' }, + { input: 'z~,', output: 'z̧', description: 'Kabyle tilde z̧ combining' }, + { input: '~y~w', output: 'ɣʷ', description: 'Kabyle tilde ɣʷ' } + ] + }, { description: 'Kabiye tilde test', inputmethod: 'kbp-tilde',