From ed2d01d5479fc190ab8753f5dd3eda608d5134de Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Wed, 7 Jul 2021 15:37:42 +0300 Subject: [PATCH] more --- src/lib/misc-helpers.test.ts | 7 +++++++ src/lib/misc-helpers.ts | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/lib/misc-helpers.test.ts b/src/lib/misc-helpers.test.ts index b3a98e5..280a741 100644 --- a/src/lib/misc-helpers.test.ts +++ b/src/lib/misc-helpers.test.ts @@ -15,7 +15,14 @@ test("parseEc should work", () => { expect(parseEc("scare")).toEqual(["scare", "scares", "scaring", "scared", "scared"]); expect(parseEc("study")).toEqual(["study","studies","studying","studied","studied"]); expect(parseEc("cry")).toEqual(["cry", "cries", "crying", "cried", "cried"]); + expect(parseEc("marry")).toEqual(["marry","marries","marrying","married","married"]); + expect(parseEc("get")).toEqual(["get","gets","getting","got","gotten"]); + expect(parseEc("become")).toEqual(["become","becomes","becoming","became","become"]); + expect(parseEc("make")).toEqual(["make","makes","making","made","made"]); + expect(parseEc("have")).toEqual(["have","has","having","had","had"]); expect(parseEc("die")).toEqual(["die", "dies", "dying", "died", "died"]); + expect(parseEc("stray")).toEqual(["stray","strays","straying","strayed","strayed"]); + expect(parseEc("cross")).toEqual(["cross","crosses","crossing","crossed","crossed"]); expect(parseEc("play")).toEqual(["play","plays","playing","played","played"]); // if there are only four items the perfect will be the same as the simple past expect(parseEc("think,thinks,thinking,thought")).toEqual(["think","thinks","thinking","thought","thought"]); diff --git a/src/lib/misc-helpers.ts b/src/lib/misc-helpers.ts index fd03123..8ddcb03 100644 --- a/src/lib/misc-helpers.ts +++ b/src/lib/misc-helpers.ts @@ -219,10 +219,25 @@ export function parseEc(ec: string): T.EnglishVerbConjugationEc { return ["a", "e", "i", "o", "u"].includes(s); } function makeRegularConjugations(s: string): T.EnglishVerbConjugationEc { + if (s === "get") { + return ["get","gets","getting","got","gotten"]; + } + if (s === "become") { + return ["become","becomes","becoming","became","become"]; + } + if (s === "make") { + return ["make","makes","making","made","made"]; + } + if (s === "have") { + return ["have","has","having","had","had"]; + } if ((s.slice(-1) === "y") && !isVowel(s.slice(-2)[0])) { const b = s.slice(0, -1); return [`${s}`, `${b}ies`, `${s}ing`, `${b}ied`, `${b}ied`]; } + if (s.slice(-2) === "ss") { + return [`${s}`, `${s}es`, `${s}ing`, `${s}ed`, `${s}ed`]; + } if (s.slice(-2) === "ie" && !isVowel(s.slice(-3)[0])) { const b = s.slice(0, -2); return [`${s}`, `${s}s`, `${b}ying`, `${s}d`, `${s}d`];