Initialize an Intl.Segmenter
masterCreate a new locale-dependent segmenter using new Intl.Segmenter(locale, options). The options object allows you to specify the granularity of the segmentation.
Supported granularity values:
"grapheme"(default): Finds boundaries between user-perceived characters."word": Finds boundaries between words and non-word characters (like spaces or punctuation)."sentence": Finds boundaries between sentences.
// Create a locale-specific word segmenter
let segmenter = new Intl.Segmenter("fr", {granularity: "word"});