italian-words

Gender and plural of Italian words

Usage no npm install needed!

<script type="module">
  import italianWords from 'https://cdn.skypack.dev/italian-words';
</script>

README

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 null in 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 null in 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.