english-a-an
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

English a/an

Determines whether a sequence (noun or adjective) should start with a or an: an elephant, a European, an Irishman, an heir, etc.

It is based on a list of words that must be preceded by an: use english-a-an-list as that list.

Usage

getAAn will return either a or an based on:

  • a list custom of exceptions: map where the word is the key, and value has a aan key with either a or an as a value; in general put just null here
  • a list of words that must be preceded by an: use english-a-an-list
  • the word as a string

Case matters:

  • English => an English, while english will not be found
  • an AND makes sense, while a/an and doesn't

Installation

npm install english-a-an

Usage

const englishAAn = require('english-a-an');
const englishAAnList = require('english-a-an-list/dist/aan.json');

// an
console.log(englishAAn.getAAn(null, englishAAnList, 'English'));

// a
console.log(englishAAn.getAAn(null, englishAAnList, 'European'));

/english-a-an/

    Package Sidebar

    Install

    npm i english-a-an

    Weekly Downloads

    240

    Version

    3.3.0

    License

    Apache-2.0

    Unpacked Size

    17.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • ludan.stoeckle