From 346dd33a4f34a696119cba770401e294d554aba3 Mon Sep 17 00:00:00 2001 From: dualfroz Date: Sat, 3 Oct 2026 03:17:23 +0200 Subject: [PATCH] Don't merge an -ent syllable back into an open first syllable --- plugins/speech/src/compute/syllables/postProcess.js | 2 +- plugins/speech/tests/syllables.test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/speech/src/compute/syllables/postProcess.js b/plugins/speech/src/compute/syllables/postProcess.js index 3c601fc..437f2c5 100644 --- a/plugins/speech/src/compute/syllables/postProcess.js +++ b/plugins/speech/src/compute/syllables/postProcess.js @@ -49,7 +49,7 @@ const postprocess = function (arr) { const first_is_open = (arr[0].length === 1 || arr[0].match(starts_with_consonant_vowel)) && arr[0].match(ends_with_vowel) - const second_is_joining = arr[1].match(joining_consonant_vowel) + const second_is_joining = arr[1].match(joining_consonant_vowel) && ones.every(re => !arr[1].match(re)) if (first_is_open && second_is_joining) { const possible_combination = arr[0] + arr[1] diff --git a/plugins/speech/tests/syllables.test.js b/plugins/speech/tests/syllables.test.js index 61b0d9a..a4f108a 100644 --- a/plugins/speech/tests/syllables.test.js +++ b/plugins/speech/tests/syllables.test.js @@ -56,6 +56,10 @@ const words = [ 'tur key', 'cor si ca', 'dev iled', + 'si lent', + 'ta lent', + 'pa rent', + 'a gent', // 'horse', // 'chance', // 'peo ple'