Closed PuneetKohli closed 4 months ago
hey Puneet, good question:
Little weird, but you could do .splitAfter('!@hasHyphen')
, like this:
https://runkit.com/spencermountain/659822ebdfb7e500085838fd
Alternatively, you could shim-in a custom tokenizer, like:
nlp.world().methods.one.tokenize.splitTerms = function (str) {
return str.split(/ /)
}
nlp('one two-three four five').debug()
// one, two-three, four, five
that one is obviously simplified, but let me know if you'd like some more help. cheers
Is there a way to achieve this?