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.
var NaturalLanguage = require('machinepack-nlp');
// Split a string into an array of strings using the Treebank algorithm.
NaturalLanguage.tokenize({
string: 'Hello world!',
}).execSync();
The string to split.
'Hello world!'
An unexpected error occurred.
OK.
[ 'Hello', 'world', '!' ]