New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flowaccount/node-icu-tokenizer

Package Overview
Dependencies
Maintainers
8
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flowaccount/node-icu-tokenizer

String Tokenizer for Node.js using ICU's BreakIterators

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created
Source

node-icu-tokenizer

Node.js String Tokenizer using ICU's BreakIterator

See http://userguide.icu-project.org/boundaryanalysis for a rundown on how the BreakIterator works.

Install the NPM module:

npm install @flowaccount/node-icu-tokenizer

Call the tokenizer:

new Tokenizer().tokenize('pretty quiet out there eh?');

Receive an array of tokens with boundaries:

[ { token: 'pretty', bounds: { start: 0, end: 6 } },
  { token: 'quiet', bounds: { start: 7, end: 12 } },
  { token: 'out', bounds: { start: 13, end: 16 } },
  { token: 'there', bounds: { start: 17, end: 22 } },
  { token: 'eh', bounds: { start: 23, end: 25 } },
  { token: '?', bounds: { start: 25, end: 26 } } ]

Tokenizer Options

locale

  • An ICU locale. Defaults to en_US

ignoreWhitespaceTokens

  • If true (default) whitespaces are ommitted as tokens. Otherwise they are treated as normal words.

Acknowledgments

This module is based off of node-icu-wordsplit, which also uses the BreakIterator for tokenizing. [https://github.com/chakrit/node-icu-wordsplit] (https://github.com/chakrit/node-icu-wordsplit)

Keywords

FAQs

Package last updated on 11 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc