-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Issue Type
- Bug (https://github.com/WaniKani/WanaKana/blob/master/.github/CONTRIBUTING.md#bug-reports)
- Feature (https://github.com/WaniKani/WanaKana/blob/master/.github/CONTRIBUTING.md#feature-requests)
Description
I an trying to use WanaKana to transliterate hiragana to romaji using the Hepburn romanisation system.
I have configured a custom mapping. There are cases where the custom mapping is not respected.
Steps to reproduce
const customRomajiMapping = {
うう: 'û',
おう: 'ô',
くう: 'kû',
こう: 'kô',
すう: 'sû',
そう: 'sô',
つう: 'tsû',
とう: 'tô',
ぬう: 'nû',
のう: 'nô',
ふう: 'fû',
ほう: 'hô',
むう: 'mû',
もう: 'mô',
ゆう: 'yû',
よう: 'yô',
ろう: 'rû',
ろう: 'rô',
ぐう: 'gû',
ごう: 'gô',
ずう: 'zû',
ぞう: 'zô',
づう: 'zû',
どう: 'dô',
ぶう: 'bû',
ぼう: 'bô',
ぷう: 'pû',
ぽう: 'pô',
きゅう: 'kyû',
きょう: 'kyô',
しゅう: 'shû',
しょう: 'shô',
ちゅう: 'chû',
ちょう: 'chô',
にゅう: 'nyû',
にょう: 'nyô',
ひゅう: 'hyû',
ひょう: 'hyô',
みゅう: 'myû',
みょう: 'myô',
りゅう: 'ryû',
りょう: 'ryô',
ぎゅう: 'gyû',
ぎょう: 'gyô',
じゅう: 'jû',
じょう: 'jô',
ぢゅう: 'jû',
ぢょう: 'jô',
びゅう: 'byû',
びょう: 'byô',
ぴゅう: 'pyû',
ぴょう: 'pyô',
}
name = toRomaji('こういち', { customRomajiMapping }) // Returns 'Kôichi' (correct)
name = toRomaji('いっこう', { customRomajiMapping }) // Returns 'Ikkou'
name = toRomaji('ゆうじ', { customRomajiMapping }) // Returns 'Yûji' (correct)
name = toRomaji('けんゆう', { customRomajiMapping }) // Returns 'Ken'yuu'
It seems that 'っ' or an apostrophe before the pattern trips it and the transliteration fails.
Versions
- Browser: Node 20
- OS/Device: Mac
- Keyboard/Input Method: UTF-8
IgorSzymanski
Metadata
Metadata
Assignees
Labels
No labels