3.3.0 • Published 7 months ago

english-verbs-helper v3.3.0

Weekly downloads
235
License
Apache-2.0
Repository
github
Last release
7 months ago

English verbs conjugation

Features

Agreement of English verbs, based on a few rules and on linguistic resources.

You have to import and provide independently linguistic resources:

  • use english-verbs-irregular for a list of irregular verbs (with their preterit and past participle)
  • use english-verbs-gerunds for a list of irregular gerunds (ing)

These resources are not declared as dependencies so that they are not automatically bundled in a browser package.

If you do not provide linguistic resources, very basic rules will be used: adding ing for gerunds, and ed for past and participles.

Usage

getConjugation will return the conjugated verb based on:

  • information about irregular verbs (preteric, past participle and gerund):
    • you can just put null if you don't care about irregular verbs, or if your tenses don't require them (only SIMPLE_PRESENT and SIMPLE_FUTURE)
    • other provide irregular verbs info, using english-verbs-irregular, and/or english-verbs-gerunds, using the provided helper mergeVerbsData
  • the verb as a string
  • the tense
  • the person: 0=I, 1=you (singular), 2=he/she/it, 3=we, 4=you (plural), 5=they.
  • ExtraParams:
    • for SIMPLE_FUTURE, you can add { GOING_TO: true } to trigger the going to form; default is { WILL: true }
    • use { NEGATIVE: true } to trigger the negative form; additionnaly add CONTRACT: true to get the contracted version (will not => won't, etc.); when using the verb to have, you can choose whether to generate hasn't or does not have using NO_DO: 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)

Limitations

  • no interrogative form
  • modals

Installation

npm install english-verbs-helper

Usage

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);

// (he/she) eats
console.log(EnglishVerbs.getConjugation(null, 'eat', 'PRESENT', 2));

// (he/she) ate
console.log(EnglishVerbs.getConjugation(VerbsData, 'eat', 'SIMPLE_PAST', 2));

// swimming
console.log(EnglishVerbs.getIngPart(VerbsData, 'swim'));
3.3.0

7 months ago

3.2.2

9 months ago

3.2.1

9 months ago

3.2.0

10 months ago

2.4.0

1 year ago

3.0.0

1 year ago

2.3.1

1 year ago

3.1.0

1 year ago

2.3.0

1 year ago

2.2.6

2 years ago

2.2.3

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.0.3

2 years ago

2.2.0

2 years ago

2.0.4

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.12.2

3 years ago

0.12.1

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.10.1

4 years ago

0.10.0

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.10

4 years ago

0.8.9

4 years ago

0.8.8

4 years ago

0.8.7

4 years ago

0.8.6

4 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago