From 12c551c1e3c233bb9aefabc9347efa7ab9d9b25d Mon Sep 17 00:00:00 2001 From: Bill D Date: Tue, 16 Mar 2021 18:17:55 +0400 Subject: [PATCH] forgot to add - to pashto simplification --- package.json | 2 +- src/lib/simplify-phonetics.test.ts | 1 + src/lib/simplify-phonetics.ts | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) 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) => {