diff --git a/src/lib/accent-helpers.ts b/src/lib/accent-helpers.ts index e170c43..9d21cdb 100644 --- a/src/lib/accent-helpers.ts +++ b/src/lib/accent-helpers.ts @@ -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; } /**