compromise-syllables
v0.0.6
Published
plugin for nlp-compromise
Downloads
146
Readme
This is a naive syllable tokenizer, and simply splits a compromise document, according to some simple, biased interpretation.
It makes some judgement-calls about pronunciation, but also where splits make the most sense.
const nlp = require('compromise')
nlp.extend(require('compromise-syllables'))
let doc = nlp('Chocolate microscopes?')
doc.terms().syllables()
/*[
{text:'Chocolate', syllables:['cho', 'co', 'late']},
{text:'microscopes?', syllables:['mic', 'ro', 'scope']}
]*/
.syllables( {options} )
will pass it's optional first parameter to .json()
. You can see the full set of options here.
Keep in mind there are cultural-differences in syllable pronunciation, which this library has a certain bias.
MIT