syllabify-it
v1.0.1
Published
Split Italian words into syllables
Downloads
7
Maintainers
Readme
syllabify-it
A JavaScript library to split Italian words into syllables.
Installation
npm install syllabify-itUsage
const { syllabify } = require("syllabify-it");
console.log(syllabify("parola")); // ["pa", "ro", "la"]
console.log(syllabify("preghiera")); // ["pre", "ghie", "ra"]
console.log(syllabify("ostacolo")); // ["o", "sta", "co", "lo"]
console.log(syllabify("tetto")); // ["tet", "to"]
console.log(syllabify("tecnico")); // ["tec", "ni", "co"]
console.log(syllabify("lingua")); // ["lin", "gua"]
console.log(syllabify("buoi")); // ["buoi"]
console.log(syllabify("maiale")); // ["ma", "ia", "le"]
console.log(syllabify("zio")); // ["zi", "o"]Features
- Handles common Italian syllabification rules
- Supports digraphs (
ch,gh) and consonant clusters (pr,tr,gl, etc.) - Basic handling of diphthongs and triphthongs
Limitations & Future Work
This library is a rule-based implementation of Italian syllabification,
following the guidelines provided by the
Accademia della Crusca.
Since Italian syllabification can involve ambiguous cases (for example, whether
a vowel sequence forms a diphthong or a hiatus), the library applies a set of
general rules without relying on a dictionary of exceptions.
This means that in some edge cases the output may vary depending on context or
pronunciation, but for the vast majority of words it reflects the normative
division in syllables.
Planned improvements
- Strict mode to force syllable breaks in all ambiguous hiatus cases.
- Exception dictionary for special words where general rules are not enough.
- Sentence support: ability to split not only single words but entire sentences, keeping punctuation and spacing intact.
