1.0.8 • Published 1 year ago

string-tokenization v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

String Tokenization

Function to convert a string into an array of its tokens.

Install

npm i string-tokenization

usage

import { tokenize } from 'string-tokenization'

// Tokenize a string
tokenize('Hello world! This is an example.', false);
// Output: ["hello", "world!", "this", "is", "an", "example."]

// Also tokenize individual words in a string
tokenize('Hello world! This is an example.', true);
// Output: [
"h", "he", "o", "hel", "lo", "hell", "llo", "hello",
"ello", "", "w", "wo","!", "wor", "d!", "worl",
"ld!", "world", "rld!", "world!","orld!", "t", "th",
"s","thi", "is", "this", "his","i", "a", "an", "n",
"e", "ex", ".", "exa","e.",  "exam", "le.", "examp",
"ple.", "exampl", "mple.", "example","ample.", "example.", "xample."
]
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago