0.0.6 • Published 3 years ago

compromise-syllables v0.0.6

Weekly downloads
71
License
MIT
Repository
github
Last release
3 years ago

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