8

Is anyone aware of any JavaScript implementations of UAX #29, Unicode Text Segmentation? I'm specifically interested in Word Boundaries.

I was hopeful when I came across XRegExp, but it seems to use the standard JavaScript implementation of \b.

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Paul Butcher
  • 10,722
  • 3
  • 40
  • 44

2 Answers2

3

https://github.com/orling/grapheme-splitter is a pure js implementation of UAX #29 Grapheme Cluster Boundaries.

There is also an ES proposal on implementing Intl.Segmenter using UAX #29, see https://github.com/tc39/proposal-intl-segmenter.

-1

https://www.npmjs.com/package/node-word-boundaries is one, but it requires Node for some unix native unicode libs; it's not pure js.

Rich
  • 15,048
  • 2
  • 66
  • 119