italian-words
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.1 • Public • Published

    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.

    Install

    npm i italian-words

    DownloadsWeekly Downloads

    883

    Version

    4.0.1

    License

    Apache-2.0

    Unpacked Size

    19.1 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar