pub trait SegmentationRules {
    fn segment<'a>(&self, section: &'a str) -> Vec<&'a str>;
    fn count_words(&self, segment: &str) -> usize;
    fn count_characters(&self, segment: &str) -> usize;
}
Expand description

Trait to define custom segmentation rules.

Required Methods

Given a section of text, most likely containing multiple sentences, segment the text into translatable units.

The amount of words in a particular segment

The amount of non-whitespace characters in a particular segment

Implementors

The Segmentation rules implementation for UnicodeRules