Segments the input text into an array of strings.
A string to be segmented.
An array of strings, where each string is a segment of the input text.
import { segment } from 'charabia-js';segment("Hello, world!") // [ 'Hello', ', ', 'world', '!' ]segment("你好,世界!") // [ '你好', ',', '世界', '!' ]segment("Hello, 世界!") // [ 'Hello', ', ', '世界', '!' ]") Copy
import { segment } from 'charabia-js';segment("Hello, world!") // [ 'Hello', ', ', 'world', '!' ]segment("你好,世界!") // [ '你好', ',', '世界', '!' ]segment("Hello, 世界!") // [ 'Hello', ', ', '世界', '!' ]")
Segments the input text into an array of strings.