Syllables
Tokenize a word approximately by it's pronounced syllables. We use a custom rule-based alortithm for this.
import plg from 'compromise-speech'
nlp.extend(plg)
let doc = nlp('seventh millenium. white collar')
doc.syllables()
[ [ 'se', 'venth', 'mil', 'le', 'nium' ], [ 'white', 'col', 'lar' ] ]
Alternatively, if you'd like to combine syllable information with other properties, you can use .compute('syllables')
let doc = nlp('edmonton oilers')
doc.compute('syllables')
doc.json()
SoundsLike
Generate an expected pronounciation for the word, as a normalized string.
We use the metaphone implementation, which is a simple rule-based pronounciation system.
import plg from 'compromise-speech'
nlp.extend(plg)
let doc = nlp('seventh millenium. white collar')
doc.soundsLike()
Alternatively, if you'd like to combine syllable information with other properties, you can use .compute('syllables')
let doc = nlp('edmonton oilers')
doc.compute('soundsLike')
doc.json()
MIT