Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
english-verbs-helper
Advanced tools
Agreement of English verbs, based on a few rules and on linguistic resources.
You have to import and provide independently linguistic resources:
english-verbs-irregular
for a list of irregular verbs (with their preterit and past participle)english-verbs-gerunds
for a list of irregular gerunds (ing
)If you do not provide linguistic resources, very basic rules will be used: adding ing
for gerunds, and ed
for past and participles.
getConjugation
will return the conjugated verb based on:
null
if you don't care about irregular verbs, or if your tenses don't require them (only SIMPLE_PRESENT
and SIMPLE_FUTURE
)english-verbs-irregular
, and/or english-verbs-gerunds
, using the provided helper mergeVerbsData
S
for he/she/it, P
for theyExtraParams
: for SIMPLE_FUTURE
, you can add { GOING_TO: true }
to trigger the going to form; default is { WILL: true }
Available tenses are: SIMPLE_PAST
(or PAST
), SIMPLE_PRESENT
(or PRESENT
), SIMPLE_FUTURE
(or FUTURE
), PROGRESSIVE_PAST
, PROGRESSIVE_PRESENT
, PROGRESSIVE_FUTURE
, PERFECT_PAST
, PERFECT_PRESENT
, PERFECT_FUTURE
, PERFECT_PROGRESSIVE_PAST
, PERFECT_PROGRESSIVE_PRESENT
, PERFECT_PROGRESSIVE_FUTURE
.
mergeVerbsData
will simply combine irregular verbs info and gerunds, to be used in getConjugation
. In practice you will have swim: ['swam', 'swum', 'swimming']
, here combining an irregular preterit, past participle and gerund. Parameters:
VerbsIrregularInfo
: use english-verbs-irregular
, or null (irregular verbs are only required for some tenses)GerundsInfo
: use english-verbs-gerunds
, or null (gerunds are only required for some tenses)he
(singular S) or they
(plural P) formsnpm install english-verbs-helper
const EnglishVerbs = require('english-verbs-helper');
const Irregular = require('english-verbs-irregular/dist/verbs.json');
const Gerunds = require('english-verbs-gerunds/dist/gerunds.json');
const VerbsData = EnglishVerbs.mergeVerbsData(Irregular, Gerunds);
// eats
console.log(EnglishVerbs.getConjugation(null, 'eat', 'PRESENT', 'S'));
// ate
console.log(EnglishVerbs.getConjugation(VerbsData, 'eat', 'SIMPLE_PAST', 'S'));
// swimming
console.log(EnglishVerbs.getIngPart(VerbsData['swim'], 'swim'));
FAQs
English verbs conjugation
We found that english-verbs-helper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.