accent counting fix

This commit is contained in:
lingdocs 2021-10-17 21:13:08 -04:00
parent 02ff873536
commit 075f8047be
1 changed files with 2 additions and 2 deletions

View File

@ -55,12 +55,12 @@ export function accentPastParticiple(s: T.PsString): T.PsString {
}
export function splitUpSyllables(f: string): string[] {
return f.match(/ |([^a|e|i|o|u| ]*(aa|a|ey|ee|e|oo|o|i|u)[^a|e|i|o|u| ]*)/g) as string[];
return f.match(/ |([^a|e|i|o|u| ]*(aa|a|ey|ee|e|oo|o|i|u)[^a|e|i|o|u| ]*)/g) || [] as string[];
}
export function countSyllables(f: T.PsString | string): number {
if (typeof f !== "string") return countSyllables(f.f);
return splitUpSyllables(removeFVarients(f)).length;
return splitUpSyllables(removeFVarients(removeAccents(f))).length;
}
/**