5.4.0 • Published 1 year ago
italian-words
Licence
Apache-2.0
Version
5.4.0
Deps
0
Size
19 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated
italian-words
Provides information on Italian words:
- Gender of Italian words, : cameriera is feminine, cameriere is masculine, etc.
- Number declination of words: the plural of cameriera is cameriere.
Use italian-words-dict as linguistic resource.
Installation
npm install italian-words
Usage
const ItalianWords = require('italian-words');
const ItalianWordsList = require('italian-words-dict/dist/words.json');
// F
console.log(ItalianWords.getGenderItalianWord(null, ItalianWordsList, 'cameriera'));
// libri
console.log(ItalianWords.getNumberItalianWord(null, ItalianWordsList, 'libro', 'P'));
// arance
console.log(ItalianWords.getNumberItalianWord(null, ItalianWordsList, 'arancia', 'P'));
getGenderItalianWord returns the gender M or F based on:
- a list of exception words that overrides default list (put
nullin general) - a list of words: see
italian-words-dict - a string param which is the word at its root form
getNumberItalianWord returns the declined word based on:
- a list of exception words that overrides default list (put
nullin general) - a list of words: see
italian-words-dict - string param which is the word at its root form
- string param which is the number (S or P)
Both throw an error when the word is not found.