diff --git a/package.json b/package.json index ec8271f..480e396 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "0.2.9", + "version": "0.3.0", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/lib/simplify-phonetics.test.ts b/src/lib/simplify-phonetics.test.ts index 0a9ceac..7b96099 100644 --- a/src/lib/simplify-phonetics.test.ts +++ b/src/lib/simplify-phonetics.test.ts @@ -18,6 +18,7 @@ const toTest: [string, string][] = [ ["săr", "sar"], ["kawúl", "kawul"], ["sắr", "sar"], + ["kaar-U-baar", "kaarUbaar"], ]; test("simplifyPhonetics should work", () => { diff --git a/src/lib/simplify-phonetics.ts b/src/lib/simplify-phonetics.ts index 9bd6b90..78a1a86 100644 --- a/src/lib/simplify-phonetics.ts +++ b/src/lib/simplify-phonetics.ts @@ -16,13 +16,14 @@ const matcher = { ó: "o", G: "g", Ú: "U", + "-": "", "\u0301": "", " ": "", "'": "", "`": "", }; -const fRepRegex = / |Ú|á|ă|ú|é|í|ó|G|q|'|`|\u0301/g; +const fRepRegex = / |Ú|á|ă|ú|é|í|ó|G|q|'|`|-|\u0301/g; export function simplifyPhonetics(f: string): string { return f.replace(fRepRegex, (mtch) => {