Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 769 Bytes

stringSegmenter.md

File metadata and controls

32 lines (24 loc) · 769 Bytes

piupiu.stringSegmenter(input, granularity, lang)

Return a snake-cased input.

Source

Since

0.1.0

Arguments

input (string) granularity (SegmentGranularity = "grapheme" | "word" | "sentence") lang (BCP47LangTag)

Returns

(Array<string>): Returns an array of strings.

Example

piupiu.stringSegmenter('Bonjour !', 'grapheme', 'fr');
//  ["B", "o", "n", "j", "o", "u", "r", " ", "!"]
piupiu.stringSegmenter('Bonjour Monsieur Martin !', 'word', 'fr');
//  ["Bonjour", "Monsieur", "Martin"]
piupiu.stringSegmenter('Bonjour Madame Ambre !', 'sentence', 'fr');
//  ["Bonjour Madame Ambre !"],