Skip to content

Commit

Permalink
Clean up Korean input method
Browse files Browse the repository at this point in the history
Follow-up to wikimedia#716.

* Rename the "kor-rr" identifier to "ko-rr" and "kor" to "ko":
  We use two-letter language codes when they are available.
* Whitespace clean-up.
  • Loading branch information
amire80 committed Oct 22, 2024
1 parent b082949 commit 88a37ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions rules/kor/kor-rr.js → rules/ko/ko-rr.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
[ '([ᅡ-ᅵ])h', '$1ᇂ' ],

// Use space, hyphen, and apostrophe to disambiguate
// Do nothing, combineJamo will do the work
// Do nothing, combineJamo will do the work
[ '([\- \'])', '$1'],

// Syllable initials
Expand Down Expand Up @@ -62,7 +62,7 @@
[ 'T', 'ᄐ' ],
[ 'p', 'ᄑ' ],
[ 'h', 'ᄒ' ],

// Vowels
// Vowels without consontant initial must have ᄋ prepended
// [^ᄀ-ᄒ]|^ matches the start character or anything but an initial consonant
Expand Down Expand Up @@ -106,7 +106,7 @@
];

var koreanRR = {
id: 'kor-rr',
id: 'ko-rr',
name: 'Korean Revised Romanization',
description: 'Transliteration using Korean revised romanization',
date: '2023-02-04',
Expand All @@ -117,7 +117,7 @@
maxKeyLength: 4,
contextLength: 1,

// This function mirrors the normal behavior in jquery.ime.js,
// This function mirrors the normal behavior in jquery.ime.js,
// except it combines jamo when a new syllable starts
// This version does not support context rules, but we don't need them
patterns: function(input, context) {
Expand All @@ -135,7 +135,7 @@
// Input string match test
if ( regex.test( input ) ) {
result = input.replace(regex, replacement);

// This regex matches jamo that form a syllable so they can be combined
var jamoRegex = /([-])([-])([-])?([-]|[\- '])(.*)$/;
if (jamoRegex.test(result)) {
Expand Down
8 changes: 4 additions & 4 deletions src/jquery.ime.inputmethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@
name: 'ಲಿಪ್ಯಂತರಣ',
source: 'rules/kn/kn-transliteration.js'
},
'kor-rr': {
'ko-rr': {
name: 'Korean Revised Romanization',
source: 'rules/kor/kor-rr.js'
source: 'rules/ko/ko-rr.js'
},
'kr-tilde': {
name: 'Kanuri tilde',
Expand Down Expand Up @@ -1466,9 +1466,9 @@
autonym: 'ಕನ್ನಡ',
inputmethods: [ 'kn-transliteration', 'kn-inscript', 'kn-kgp', 'kn-inscript2' ]
},
kor: {
ko: {
autonym: '한국어',
inputmethods: [ 'kor-rr' ]
inputmethods: [ 'ko-rr' ]
},
kr: {
autonym: 'kanuri',
Expand Down
2 changes: 1 addition & 1 deletion test/jquery.ime.test.fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -4186,7 +4186,7 @@ var palochkaVariants = {
},
{
description: 'Korean RR test',
inputmethod: 'kor-rr',
inputmethod: 'ko-rr',
tests: [
// Note that RR is meant to romanize from hangul to latin script, but not
// the other way around, so there are some instances where the keystrokes
Expand Down

0 comments on commit 88a37ee

Please sign in to comment.