Agreement of Italian adjectives, based on the gender and number of the word.
Manages irregular adjectives (bello buono grande santo) when placed before the noun.
italian-adjectives-dict as linguistic resource.
npm install italian-adjectives
const ItalianAdjectives = require('italian-adjectives'); const ItalianAdjectivesList = require('italian-adjectives-dict/dist/adjectives.json'); // azzurre console.log(ItalianAdjectives.agreeItalianAdjective(null, ItalianAdjectivesList, 'azzurro', 'F', 'P')); // Sant' console.log(ItalianAdjectives.agreeItalianAdjective(null, ItalianAdjectivesList, 'Santo', 'F', 'S', 'Anna', true));
One main function
agreeitalianAdjective that takes multiple parameters and return the agreed adjective:
- exception data that overrides adjective data (usually just put
- adjective data (linguistic resource), see
adjective: the adjective to agree; it must be the lemma, not the agreed form (i.e. azzurro not azzurre); when participe put the masculine singular (
educatoMP => educati)
gendergender of the word;
number: number of the word;
trueand the adjective is irregular, you must indicate the noun
trueif the adjective is meant to be placed before the noun; default is
getAdjectiveInfo to get raw data about an adjective.
Possessive articles (
tio etc.) are supported (and you do not need to put
isBeforeNoun to true).