### Usage of Word and Stress classes Source: https://github.com/weiwei/silabacion/blob/master/README.md Demonstrates how to instantiate a Word object to retrieve syllable information, stress type, rhyme, and tonic syllable, as well as how to inspect hiatuses, diphthongs, and triphthongs. ```typescript import { Word, Stress } from 'silabacion'; const word = new Word('hispanófilo'); console.log(word.word); // hispanófilo console.log(word.length); // 11 console.log(word.syllables.length); // 5 console.log(word.syllables[0]); // { onset: 'h', nucleus: 'i', coda: 's' } console.log(Stress[word.stress]); // Proparoxytone console.log(word.rhyme); // ófilo console.log(word.tonic); // { onset: 'f', nucleus: 'i', coda: '' } const word = new Word('aéreo'); console.log(word.hiatuses); // [ // { syllableIndex: 0, composite: 'aé', type: 1 }, // { syllableIndex: 2, composite: 'eo', type: 0 } // ] console.log(word.diphthongs); // [] console.log(word.triphthongs); // [] // Note: diphthongs and hiatuses have a enum type attribute export enum HiatusType { Simple, Acentual, } export enum DiphthongType { Creciente, Decreciente, Homogéneo, } ``` -------------------------------- ### Word Class Source: https://github.com/weiwei/silabacion/blob/master/README.md The Word class is the primary interface for analyzing Spanish words. It provides properties to access syllabic structure, stress, and phonetic components. ```APIDOC ## Word Class ### Description Represents a Spanish word and provides methods to analyze its syllabic structure, stress, and phonetic components. ### Constructor `new Word(word: string)` ### Properties - **word** (string) - The original word string. - **length** (number) - The length of the word. - **syllables** (Array) - An array of syllable objects containing `onset`, `nucleus`, and `coda`. - **stress** (number) - The stress index of the word. - **rhyme** (string) - The rhyme of the word. - **tonic** (Object) - The tonic syllable components (`onset`, `nucleus`, `coda`). - **hiatuses** (Array) - List of hiatuses found in the word. - **diphthongs** (Array) - List of diphthongs found in the word. - **triphthongs** (Array) - List of triphthongs found in the word. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.