regular english verbs ending in y like study

This commit is contained in:
lingdocs 2021-07-05 18:32:44 +03:00
parent 96b8ccf32c
commit fe55a02f96
4 changed files with 9 additions and 3 deletions

View File

@ -48,7 +48,7 @@ function getFromTsS(entries) {
const missingEc = []; const missingEc = [];
const toReturn = allTsS.map(ts => { const toReturn = allTsS.map(ts => {
const entry = entries.find(x => ts === x.ts); const entry = entries.find(x => ts === x.ts);
if (!entry.ec) { if (!entry.ec && !entry.e.includes("to be ")) {
missingEc.push(entry.ts); missingEc.push(entry.ts);
} }
if (!entry) { if (!entry) {

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "0.5.6", "version": "0.5.7",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",
@ -66,7 +66,8 @@
"eject": "react-scripts eject", "eject": "react-scripts eject",
"build-website": "node get-verbs.js && npm run build", "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", "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": { "eslintConfig": {
"extends": [ "extends": [

View File

@ -13,6 +13,7 @@
test("parseEc should work", () => { test("parseEc should work", () => {
expect(parseEc("walk")).toEqual(["walk", "walks", "walking", "walked", "walked"]); expect(parseEc("walk")).toEqual(["walk", "walks", "walking", "walked", "walked"]);
expect(parseEc("scare")).toEqual(["scare", "scares", "scaring", "scared", "scared"]); 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"]);
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"]);
}); });

View File

@ -216,6 +216,10 @@ export function isNounAdjOrVerb(entry: T.DictionaryEntry): "nounAdj" | "verb" |
*/ */
export function parseEc(ec: string): T.EnglishVerbConjugationEc { export function parseEc(ec: string): T.EnglishVerbConjugationEc {
function makeRegularConjugations(s: 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") const b = (s.slice(-1) === "e")
? s.slice(0, -1) ? s.slice(0, -1)
: s; : s;