diff --git a/rules/btd/btd-keyboard.js b/rules/btd/btd-keyboard.js new file mode 100644 index 00000000..c257408b --- /dev/null +++ b/rules/btd/btd-keyboard.js @@ -0,0 +1,63 @@ +( function ( $ ) { + 'use strict'; + + var pakpakDairiKbd = { + id: 'btd-keyboard', + name: 'Surat Pakpak (Dairi)', + description: 'QWERTY-based Batak Pakpak (Dairi) keyboard', + date: '2023-07-28', + URL: 'https://www.mediawiki.org/wiki/Help:Extension:UniversalLanguageSelector/Input_methods/btd-keyboard', + author: 'Benny Lin', + license: 'GPLv3', + version: '1.0', + patterns: [ + [ '(q|Q)', '᯲' ],// 1BF2 ᯲ BATAK PANGOLAT (PANGGOTAP) = virama + [ '(w|W)', 'ᯍ' ],//1BCD ᯍ BATAK LETTER PAKPAK WA + [ 'e', 'ᯨ' ],//1BE8 ᯨ BATAK VOWEL SIGN PAKPAK E = ketolongen + [ 'E', 'ᯧ' ],//1BE7 ᯧ BATAK VOWEL SIGN E = kebereten + [ '(r|R)', 'ᯒ' ],//1BD2 ᯒ BATAK LETTER RA + [ 't', 'ᯖ' ],//1BD6 ᯖ BATAK LETTER SOUTHERN TA + [ 'T', 'ᯗ' ],//1BD7 ᯗ BATAK LETTER NORTHERN TA + [ '(y|Y)', 'ᯛ' ],//1BDB ᯛ BATAK LETTER YA + [ 'u', 'ᯮ' ],//1BEE ᯮ BATAK VOWEL SIGN U = boruta + [ 'U', 'ᯥ' ],//1BE5 ᯥ BATAK LETTER ina ni surat U + [ 'i', 'ᯪ' ],//1BEA ᯪ BATAK VOWEL SIGN I = ulua + [ 'I', 'ᯤ' ],//1BE4 ᯤ BATAK LETTER ina ni surat I + [ '(o|O)', 'ᯬ' ],//1BEC ᯬ BATAK VOWEL SIGN O = siala ulu + [ '(p|P)', 'ᯇ' ],//1BC7 ᯇ BATAK LETTER PA + + [ '(a|A)', 'ᯀ' ],//1BC0 ᯀ BATAK LETTER A + [ '(s|S)', 'ᯘ' ],//1BD8 ᯘ BATAK LETTER SA + [ '(d|D)', 'ᯑ' ],//1BD1 ᯑ BATAK LETTER DA + [ '(f|F)', '᯳' ],//1BF3 ᯳ BATAK PANONGONAN = virama + [ '(g|G)', 'ᯎ' ],//1BCE ᯎ BATAK LETTER GA + [ 'h', 'ᯀ' ],//1BC0 ᯀ BATAK LETTER A = HA + [ 'H', 'ᯱ' ],//1BF1 ᯱ BATAK CONSONANT SIGN H = hajoringan (-h) + [ '(j|J)', 'ᯐ' ],//1BD0 ᯐ BATAK LETTER JA + [ '(k|K)', 'ᯂ' ],//1BC2 ᯂ BATAK LETTER HA = KA + [ '(l|L)', 'ᯞ' ],//1BDE ᯞ BATAK LETTER LA + + [ 'z', 'ᯝ' ],//1BDD ᯝ BATAK LETTER NGA + [ 'Z', 'ᯰ' ],//1BF0 ᯰ BATAK CONSONANT SIGN NG = amisara (-ng) + [ '(x|X)', 'ᯠ' ],//1BE0 ᯠ BATAK LETTER NYA + [ '(c|C)', 'ᯘ' ],//1BD8 ᯘ BATAK LETTER SA = CA + [ '(v|V)', '᯦' ],//1BE6 ᯦ BATAK SIGN TOMPI + [ '(b|B)', 'ᯅ' ],//1BC5 ᯅ BATAK LETTER BA + [ '(n|N)', 'ᯉ' ],//1BC9 ᯉ BATAK LETTER NA + [ '(m|M)', 'ᯔ' ],//1BD4 ᯔ BATAK LETTER MA + + [ '^^', '^' ], + [ '^', 'ᯰ' ],//1BF0 ᯰ BATAK CONSONANT SIGN NG = amisara (-ng) + [ '<<', '<' ], + [ '<', 'ᯝ' ]//1BDD ᯝ BATAK LETTER NGA + ], + patterns_x: [ + [ '4', '᯼' ],//1BFC ᯼ BATAK SYMBOL BINDU NA METEK + [ '5', '᯽' ],//1BFD ᯽ BATAK SYMBOL BINDU PINARBORAS + [ '6', '᯾' ],//1BFE ᯾ BATAK SYMBOL BINDU JUDUL + [ '7', '᯿' ]//1BFF ᯿ BATAK SYMBOL BINDU PANGOLAT + ] + }; + + $.ime.register( pakpakDairiKbd ); +}( jQuery ) ); \ No newline at end of file diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index 60866d1e..09ce9eb6 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -80,6 +80,10 @@ name: 'Toba Transliteration', source: 'rules/bbc/bbc-transliteration.js' }, + 'btd-keyboard': { + name: 'Pakpak (Dairi) Keyboard', + source: 'rules/btd/btd-keyboard.js' + }, 'btx-keyboard': { name: 'Karo Keyboard', source: 'rules/btx/btx-keyboard.js' @@ -1102,6 +1106,10 @@ autonym: 'Batak Toba', inputmethods: [ 'bbc-transliteration' ] }, + btd: { + autonym: 'Batak Pakpak (Dairi)', + inputmethods: [ 'btd-keyboard' ] + }, btx: { autonym: 'Batak Karo', inputmethods: [ 'btx-keyboard' ] diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index 3d5785d8..7fd914a9 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -390,6 +390,52 @@ var palochkaVariants = { { input: [ [ '7', true ] ], output: '᯿', description: 'Toba Transliteration - alt-7 - bindu pangolat' } ] }, + { + description: 'Batak Pakpak (Dairi) keyboard test', + inputmethod: 'btd-keyboard', + tests: [ + { input: 'q', output: '᯲', description: 'Pakpak (Dairi) keyboard - q = pangolat' }, + { input: 'w', output: 'ᯍ', description: 'Pakpak (Dairi) keyboard - wa' }, + { input: 'e', output: 'ᯨ', description: 'Pakpak (Dairi) keyboard = -e' }, + { input: 'r', output: 'ᯒ', description: 'Pakpak (Dairi) keyboard - ra' }, + { input: 't', output: 'ᯖ', description: 'Pakpak (Dairi) keyboard - southern ta' }, + { input: 'y', output: 'ᯛ', description: 'Pakpak (Dairi) keyboard - ya' }, + { input: 'u', output: 'ᯮ', description: 'Pakpak (Dairi) keyboard = -u' }, + { input: 'i', output: 'ᯪ', description: 'Pakpak (Dairi) keyboard = -i' }, + { input: 'o', output: 'ᯬ', description: 'Pakpak (Dairi) keyboard = -o' }, + { input: 'p', output: 'ᯇ', description: 'Pakpak (Dairi) keyboard - pa' }, + + { input: 'a', output: 'ᯀ', description: 'Pakpak (Dairi) keyboard - a' }, + { input: 's', output: 'ᯘ', description: 'Pakpak (Dairi) keyboard - sa' }, + { input: 'd', output: 'ᯑ', description: 'Pakpak (Dairi) keyboard - da' }, + { input: 'f', output: '᯳', description: 'Pakpak (Dairi) keyboard - f = panongonan' }, + { input: 'g', output: 'ᯎ', description: 'Pakpak (Dairi) keyboard - ga' }, + { input: 'h', output: 'ᯀ', description: 'Pakpak (Dairi) keyboard - ha = a' }, + { input: 'j', output: 'ᯐ', description: 'Pakpak (Dairi) keyboard - ja' }, + { input: 'k', output: 'ᯂ', description: 'Pakpak (Dairi) keyboard - ka' }, + { input: 'l', output: 'ᯞ', description: 'Pakpak (Dairi) keyboard - la' }, + + { input: 'z', output: 'ᯝ', description: 'Pakpak (Dairi) keyboard - z = nga' }, + { input: 'x', output: 'ᯠ', description: 'Pakpak (Dairi) keyboard - x = nya' }, + { input: 'c', output: 'ᯘ', description: 'Pakpak (Dairi) keyboard - ca = sa' }, + { input: 'v', output: '᯦', description: 'Pakpak (Dairi) keyboard - v = tompi' }, + { input: 'b', output: 'ᯅ', description: 'Pakpak (Dairi) keyboard - ba' }, + { input: 'n', output: 'ᯉ', description: 'Pakpak (Dairi) keyboard - na' }, + { input: 'm', output: 'ᯔ', description: 'Pakpak (Dairi) keyboard - ma' }, + + { input: 'E', output: 'ᯧ', description: 'Pakpak (Dairi) keyboard - E - kebereten' }, + { input: 'T', output: 'ᯗ', description: 'Pakpak (Dairi) keyboard - northern ta' }, + { input: 'U', output: 'ᯥ', description: 'Pakpak (Dairi) keyboard - U - syllable "u"' }, + { input: 'I', output: 'ᯤ', description: 'Pakpak (Dairi) keyboard - I - syllable "i"' }, + { input: 'H', output: 'ᯱ', description: 'Pakpak (Dairi) keyboard - H - hajoringan "-h"' }, + { input: 'Z', output: 'ᯰ', description: 'Pakpak (Dairi) keyboard - Z - amisara "-ng"' }, + + { input: [ [ '4', true ] ], output: '᯼', description: 'Pakpak (Dairi) keyboard - alt-4 - bindu na metek' }, + { input: [ [ '5', true ] ], output: '᯽', description: 'Pakpak (Dairi) keyboard - alt-5 - bindu pinarboras' }, + { input: [ [ '6', true ] ], output: '᯾', description: 'Pakpak (Dairi) keyboard - alt-6 - bindu judul' }, + { input: [ [ '7', true ] ], output: '᯿', description: 'Pakpak (Dairi) keyboard - alt-7 - bindu pangolat' } + ] + }, { description: 'Batak Karo keyboard test', inputmethod: 'btx-keyboard',