From fe55a02f96bbcb3fb1880b4bcb9d4bbd3574ca13 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Mon, 5 Jul 2021 18:32:44 +0300 Subject: [PATCH] regular english verbs ending in y like study --- get-verbs.js | 2 +- package.json | 5 +++-- src/lib/misc-helpers.test.ts | 1 + src/lib/misc-helpers.ts | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/get-verbs.js b/get-verbs.js index c29a2fe..7673d05 100644 --- a/get-verbs.js +++ b/get-verbs.js @@ -48,7 +48,7 @@ function getFromTsS(entries) { const missingEc = []; const toReturn = allTsS.map(ts => { const entry = entries.find(x => ts === x.ts); - if (!entry.ec) { + if (!entry.ec && !entry.e.includes("to be ")) { missingEc.push(entry.ts); } if (!entry) { diff --git a/package.json b/package.json index eb550f3..6cad6fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "0.5.6", + "version": "0.5.7", "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", @@ -66,7 +66,8 @@ "eject": "react-scripts eject", "build-website": "node get-verbs.js && npm run build", "build-library": "node get-verbs.js && rimraf dist && rimraf dist-cjs && tsc --project library-tsconfig.json && node library-post-build.js && rollup -c", - "test-ci": "npm run test -- --watchAll=false" + "test-ci": "npm run test -- --watchAll=false", + "get-verbs": "node get-verbs.js" }, "eslintConfig": { "extends": [ diff --git a/src/lib/misc-helpers.test.ts b/src/lib/misc-helpers.test.ts index 8b57be4..8581214 100644 --- a/src/lib/misc-helpers.test.ts +++ b/src/lib/misc-helpers.test.ts @@ -13,6 +13,7 @@ test("parseEc should work", () => { expect(parseEc("walk")).toEqual(["walk", "walks", "walking", "walked", "walked"]); expect(parseEc("scare")).toEqual(["scare", "scares", "scaring", "scared", "scared"]); + expect(parseEc("study")).toEqual(["study","studies","studying","studied","studied"]); expect(parseEc("sew,sews,sewing,sewed,sown")).toEqual(["sew", "sews", "sewing", "sewed", "sown"]); expect(parseEc(" sew, sews,sewing ,sewed, sown")).toEqual(["sew", "sews", "sewing", "sewed", "sown"]); }); \ No newline at end of file diff --git a/src/lib/misc-helpers.ts b/src/lib/misc-helpers.ts index fed2425..1003507 100644 --- a/src/lib/misc-helpers.ts +++ b/src/lib/misc-helpers.ts @@ -216,6 +216,10 @@ export function isNounAdjOrVerb(entry: T.DictionaryEntry): "nounAdj" | "verb" | */ export function parseEc(ec: string): T.EnglishVerbConjugationEc { function makeRegularConjugations(s: string): T.EnglishVerbConjugationEc { + if (s.slice(-1) === "y") { + const b = s.slice(0, -1); + return [`${s}`, `${b}ies`, `${s}ing`, `${b}ied`, `${b}ied`]; + } const b = (s.slice(-1) === "e") ? s.slice(0, -1) : s;