0.3.4 • Published 7 years ago

tokenize-monster v0.3.4

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Tokenize Monster

Yet another powerful tokenizer in JS.

Installation

npm install --save tokenize-monster

Getting Started

const tokenizer = require('tokenize-monster');

const tokens = tokenizer.matchAndMap(
	'i\'d like to <drink> some <milk>',
	/<[^><]+>/,
	text => [[text]],
	text => [text]
);

console.log(tokens);
// => [ 'i\'d like to ', [ '<drink>' ], ' some ', [ '<milk>' ], '' ]

const nTokens = tokenizer.matchAndMap(
	'i\'d like to <drink> some <milk>',
	/<[^><]+>/,
	text => [text],
	text => []
);

console.log(nTokens);
// => [ '<drink>', '<milk>' ]

Example

Documentation

Our docs are available at Tokenize Monster Wiki.

Changelog

Visit Github Releases page for more information.

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago