Segment strings by lines, graphemes, words, and sentences.
This module is published as its own crate (icu_segmenter
)
and as part of the icu
crate. See the latter for more details on the ICU4X project.
This module contains segmenter implementation for the following rules.
line-break
] and
[word-break
] properties.Find line break opportunities:
```rust use icu::segmenter::LineSegmenter;
let segmenter = LineSegmenter::new_auto();
let breakpoints: Vec
See [LineSegmenter
] for more examples.
Find all grapheme cluster boundaries:
```rust use icu::segmenter::GraphemeClusterSegmenter;
let segmenter = GraphemeClusterSegmenter::new();
let breakpoints: Vec
See [GraphemeClusterSegmenter
] for more examples.
Find all word boundaries:
```rust use icu::segmenter::WordSegmenter;
let segmenter = WordSegmenter::new_auto();
let breakpoints: Vec
See [WordSegmenter
] for more examples.
Segment the string into sentences:
```rust use icu::segmenter::SentenceSegmenter;
let segmenter = SentenceSegmenter::new();
let breakpoints: Vec
See [SentenceSegmenter
] for more examples.
For more information on development, authorship, contributing etc. please visit ICU4X home page
.