There's a TC39 proposal (currently at stage 3) for an text segmentation API: https://github.com/tc39/proposal-intl-segmenter
This could replace the current implementation that uses RegEx to find words.
May be worth having a look at it, although browser support is still unsure...
There's a TC39 proposal (currently at stage 3) for an text segmentation API: https://github.com/tc39/proposal-intl-segmenter
This could replace the current implementation that uses RegEx to find words.
May be worth having a look at it, although browser support is still unsure...