npm.io
2.0.2 • Published 4 years ago

@textlint-rule/tokenize-english

Licence
Apache-2.0
Version
2.0.2
Deps
1
Size
28 kB
Vulns
0
Weekly
0

@textlint-rule/tokenize-english

Javascript tokenizer for english sentences.

Installation

$ npm install @textlint-rule/tokenize-english

Usage

var tokenize = require('@textlint-rule/tokenize-text')();
var tokenizeEnglish = require('@textlint-rule/tokenize-english')(tokenize);

var tokens = tokenizeEnglish.sentences("On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S. Millions attended the Inauguration.")

/*
[ { index: 0,
    value: 'On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S.',
    offset: 74 },
  { index: 74,
    value: ' Millions attended the Inauguration.',
    offset: 36 } ]
*/