Add Ho Latin Semicolon - #859
Conversation
srish
left a comment
There was a problem hiding this comment.
Thanks for this PR! The layout is wired up correctly but there are a few bugs that break normal typing, so this needs another pass before it can go in.
- The dots in the patterns act as wildcards
Patterns become regexes as-is (src/jquery.ime.js:199). In a regex, . means "any character" - so A.. matches A followed by any two characters, not A followed by two dots.
This breaks normal words. Typing disum gives dïm, and Ho jagar gives Họạr. Line 225 has the same issue: .; eats whatever comes before the ;, so x; becomes ·.
The fix is to escape the dots on lines 56, 70, 83, 96, 110, 153, 167, 180, 193, 207, and 225:
[ 'A\.\.', 'Ạ' ], // instead of 'A\u002E\u002E'
[ '\.;', '·' ] // instead of '\u002E;'
Every other rule file does it this way - see rules/ur/ur-phonetic.js:95 and rules/kab/kab-tilde.js:35.
I think this also explains the //causes issues and //messes up comments. Your note about z; turning into ṭṕ is this same bug - t.. was matching the t, the accent, and a space. Worth trying those patterns again once the dots are escaped. Many may just work.
- The escape rule for ^ leaves a stray backslash
On line 221, the replacement is '\^' - a backslash plus a caret. So typing ^ gives you ^ instead of ^. The backslash is meant to be swallowed.
Line 223 does it right - its replacement is '\u003E', just a plain >.
[ '\\\^', '\u005E' ], // drop the backslash from the replacement
- Please add a few plain-word tests
All the current tests pass, but every test input is a like A;E;I;O;U;, so none of them hit the wildcard bug.
A couple of normal words would have caught it:
{ input: 'disum', output: 'disum', description: 'Ho plain word passthrough' },
{ input: 'Ho jagar', output: 'Ho jagar', description: 'Ho plain phrase passthrough' },
- Linting
Please run:
npx eslint --fix rules/hoc-latn/hoc-latn-semicolon.js
That fixes a lot of the linting errors. The rest are indentation - the pattern lines use 2 tabs, but the rest of the file uses 3. hoc-latn-tilde.js is a good reference.
- Please remove the commented-out code
There's a lot of it in the rule file, plus a commented-out test block at test/jquery.ime.test.fixtures.js:2470. Either fix it and turn it on, or delete it.
One related thing: lines 219–220 comment out the escapes for ~ and `. That means there's no way to type a plain tilde after a vowel - a~ always becomes ã. < and > still work, so these two are worth turning back on.
Two questions
- On lines 83 and 110, I.. gives Ï and U.. gives Ü (dieresis), but A.., E.., and O.. give Ạ, Ẹ, Ọ (dot below). Is that on purpose, or should they be Ị and Ụ? As it stands, I.. gives you the same character the Ĩ; cycle already produces.
- P; and W; both give Ṕ (lines 24 and 25, and lowercase on 145 and 146). Is that a deliberate alias or a copy-paste slip?
Happy to take another look once the escaping and the tests are in.
|
Hi @srish, thank you very much for the detailed comment, it was very helpful. I couldn't get my head around which characters needed escaping and how many times. It is finally done. ẠẸỌ would be required when showing effective pronunciation of some words where a, e and o are pronounced as if they are e, i and u; i and u do not have alternative pronunciations. When typing on a physical keyboard, the sequence p; isn't very convenient, that's why w; is an option. |
|
@Singitur Thank you so much for addressing the comment and for fixing all the rules and test cases. I pulled the branch and tested it and with new changes this PR is looking in good shape. I will merge it! One thing - for the documentation if you are interested you can expand this page: https://www.mediawiki.org/wiki/Help:Extension:UniversalLanguageSelector/Input_methods/hoc-latn-semicolon. For reference you can take a look at other input methods documentation here https://www.mediawiki.org/wiki/Help:Extension:UniversalLanguageSelector/Input_methods. |
|
@Singitur Hi there! I wanted to invite you to an upcoming Wikimedia Language Community meeting to hear from you about the work you’ve been doing on the Ho language. We’d love to learn more about your work and experiences. If you’re interested, could you share your preferred contact method (email or Telegram) here: https://meta.wikimedia.org/wiki/User:SSethi_(WMF)? Thank you! 😊 |
This layout aims to use semicolon to generate characters with diacritics. Though it was intended that entering semicolon would circle through all characters with diacritics endlessly, t; > ṭ and z; > t́ cause problems. There was also an intention to have a way to escape ~ ` and ^, but it doesn't work entirely, probably due to wrong use of escape sequence in the code.
It has passed the test. All lines that are commented off are for future implementation.