NaturalLanguage.tokenize()

Split a string into an array of strings using the Treebank algorithm.

Like `split` from `machinepack-strings`, but instead of a regular expression, this machine uses a specialized algorithm for natural language processing.

Usage

Hover over inputs/exits for more info.

var NaturalLanguage = require('machinepack-nlp');


// Split a string into an array of strings using the Treebank algorithm.

NaturalLanguage.tokenize({

string: 'Hello world!',

}).execSync();

Inputs

string required

The string to split.

'Hello world!'

Exits

error

An unexpected error occurred.

success

OK.

[ 'Hello', 'world', '!' ]