From 075f8047bef0a6625281dcb15dc6199bb0189dbc Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sun, 17 Oct 2021 21:13:08 -0400 Subject: [PATCH] accent counting fix --- src/lib/accent-helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } /**