english-verbs-helper
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -78,2 +78,21 @@ "use strict"; | ||
} | ||
function getCommonEdPart(verb) { | ||
if (verb.endsWith('ie') || verb.endsWith('ee')) { | ||
return verb + 'd'; | ||
} | ||
else if (yWithVowel(verb)) { | ||
// vowel + y: play -> played | ||
return verb + 'ed'; | ||
} | ||
else if (verb.endsWith('y')) { | ||
// no vowel + y: cry -> cried | ||
return verb.substring(0, verb.length - 1) + 'ied'; | ||
} | ||
else if (verb.endsWith('e')) { | ||
return verb + 'd'; | ||
} | ||
else { | ||
return verb + 'ed'; | ||
} | ||
} | ||
function getPastPart(verbInfo, verb) { | ||
@@ -88,3 +107,3 @@ let irregular; | ||
else { | ||
return verb + 'ed'; | ||
return getCommonEdPart(verb); | ||
} | ||
@@ -106,3 +125,3 @@ } | ||
else { | ||
return verb + 'ed'; | ||
return getCommonEdPart(verb); | ||
} | ||
@@ -116,3 +135,3 @@ } | ||
} | ||
else if (verb.match(new RegExp(`[${consonants}]e$`, 'g')) && verb != 'be') { | ||
else if (verb.match(new RegExp(`[${consonants}]e$`, 'g')) && verb != 'be' && verb != 'singe') { | ||
// If the infinitive ends with a consonant followed by an –e, | ||
@@ -139,2 +158,5 @@ // you have to take off the –e to form your present participle. | ||
} | ||
function yWithVowel(verb) { | ||
return verb.match(/[aeiouy]y$/); | ||
} | ||
function getSimplePresent(verb, number) { | ||
@@ -165,3 +187,3 @@ if (number === 'P') { | ||
} | ||
else if (verb.match(/[aeiouy]y$/)) { | ||
else if (yWithVowel(verb)) { | ||
// vowel + y: play -> plays | ||
@@ -168,0 +190,0 @@ return verb + 's'; |
{ | ||
"name": "english-verbs-helper", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "English verbs conjugation", | ||
@@ -48,4 +48,4 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"english-verbs-gerunds": "1.1.7", | ||
"english-verbs-irregular": "1.1.7" | ||
"english-verbs-gerunds": "1.1.8", | ||
"english-verbs-irregular": "1.1.8" | ||
}, | ||
@@ -63,3 +63,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a501d0473fdc12407624be4eac58618e1702dcdc" | ||
"gitHead": "dfcd8d00b365feeb9aeda8ab0b311f12b94ac630" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
33436
314