nlp-compromise / website

nlpcompromise.com demos and docs
http://nlp-compromise.github.io/website/
MIT License
2 stars 5 forks source link

syllables not coming out correctly on the website #16

Open factormystic opened 8 years ago

factormystic commented 8 years ago

right now, houston texas is

which is wrong. but houstontexas is

and houston and texas separately are also correct. pretty sure this is a website thing, because:

let s = nlp.text("houston texas").syllables();
> [ [ [ 'hous', 'ton' ], [ 'te', 'xas' ] ] ]
spencermountain commented 8 years ago

yeah, thanks. this nested response format is pretty nutty. Term.syllables() should definitely always return an array of strings, no matter how many words are in the term. I don't know why it's doing that.

nloveladyallen commented 8 years ago

Huh. I'm seeing it one level deeper than @factormystic.

> nlp.text('houston texas').syllables()
[ [ [ [Object], [Object] ] ] ]
> nlp.text('houston texas').syllables()[0]
[ [ [ 'hous', 'ton' ], [ 'te', 'xas' ] ] ]
spencermountain commented 8 years ago

yeah. I also had the thought that maybe it should return this, just like all the other text/sentence methods do - that way you can be smart about whitespace and all.