This commit is contained in:
Samuel Thibault
2022-11-08 00:05:19 +01:00
committed by GitHub
2 changed files with 15 additions and 6 deletions
+7 -6
View File
@@ -695,6 +695,10 @@ static int IsLetterGroup(Translator *tr, char *word, int group, int pre)
return -1;
while (*p != RULE_GROUP_END) {
// If '~' (no character) is allowed in group, return 0.
if (*p == '~')
return 0;
if (pre) {
len = strlen(p);
w = word;
@@ -702,16 +706,12 @@ static int IsLetterGroup(Translator *tr, char *word, int group, int pre)
{
w--;
if (*w == 0)
// Not found
return -1;
// Not found, skip the rest of this group.
goto skip;
}
} else
w = word;
// If '~' (no character) is allowed in group, return 0.
if (*p == '~')
return 0;
// Check current group
while ((*p == *w) && (*w != 0)) {
w++;
@@ -724,6 +724,7 @@ static int IsLetterGroup(Translator *tr, char *word, int group, int pre)
}
// No match, so skip the rest of this group.
skip:
while (*p++ != 0)
;
}
+8
View File
@@ -105,3 +105,11 @@ test_phon cmn "ni35X'Au35_| m'A21_| (en)h@44loU11_| De@11(cmn)_|" "你好馬 hel
test_phon cmn-latn-pinyin "ni35X'Au35_| m'A35_| n'i35_| X'Au35_| m'A214_|" "你好馬 ni3 hao3 ma3"
test_phon cmn "thiE55nt'i51_|" "天地"
# https://github.com/espeak-ng/espeak-ng/issues/1507
test_phon ml "k'a
t'a
p'a
k'e:r@l.@m
t'a:m@ra
p'o:le" "ക: ത: പ: കേരളം: താമര: പോലെ:"