compromise-syllables
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published
a plugin for compromise

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.

npm install compromise-syllables

Demo

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

Readme

Keywords

none

Package Sidebar

Install

npm i compromise-syllables

Weekly Downloads

95

Version

0.0.6

License

MIT

Unpacked Size

41.8 kB

Total Files

9

Last publish

Collaborators

  • spencermountain