Javascript implementation of UAX 29 Unicode Text Segmentation? [closed]

拟墨画扇 提交于 2020-12-08 07:33:40

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/23470062/javascript-implementation-of-uax-29-unicode-text-segmentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!