From b784e5b11a596a456eb8879d394fde64bc63aaef Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 27 Sep 2021 18:19:53 -0400 Subject: Katakana to hiragana conversion options (#1965) * Refactor convertKatakanaToHiragana * Add keepProlongedSoundMarks option * Test keepProlongedSoundMarks option * Refactor * Add keepProlongedSoundMarks option to hiragana handlebars helper * Update documentation --- test/test-japanese-util.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test-japanese-util.js b/test/test-japanese-util.js index f3b53844..cf1ee87e 100644 --- a/test/test-japanese-util.js +++ b/test/test-japanese-util.js @@ -130,11 +130,13 @@ function testConvertKatakanaToHiragana() { ['ヒラガナひらがな', 'ひらがなひらがな'], ['chikaraちからチカラ力', 'chikaraちからちから力'], ['katakana', 'katakana'], - ['hiragana', 'hiragana'] + ['hiragana', 'hiragana'], + ['カーナー', 'かあなあ'], + ['カーナー', 'かーなー', true] ]; - for (const [string, expected] of data) { - assert.strictEqual(jp.convertKatakanaToHiragana(string), expected); + for (const [string, expected, keepProlongedSoundMarks=false] of data) { + assert.strictEqual(jp.convertKatakanaToHiragana(string, keepProlongedSoundMarks), expected); } } -- cgit v1.2.3