english-a-an
Version:
English a/an indefinite articles, based on WordNet
27 lines • 805 B
JavaScript
;
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAAn = void 0;
// manual ones
const moreExceptions = { Irishman: 1, SSO: 1, HEPA: 1, AI: 1, honour: 1 };
function getAAn(contractsData, anList, text) {
if (!text) {
const err = new Error();
err.name = 'TypeError';
err.message = 'text must not be null';
throw err;
}
if (contractsData && contractsData[text] && contractsData[text].aan) {
return contractsData[text].aan;
}
else if ((anList && anList[text] == 1) || (moreExceptions && moreExceptions[text] == 1)) {
return 'an';
}
return 'a';
}
exports.getAAn = getAAn;
//# sourceMappingURL=index.js.map