Trait filecount::segmentation::SegmentationRules
source · [−]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
sourcefn segment<'a>(&self, section: &'a str) -> Vec<&'a str>
fn segment<'a>(&self, section: &'a str) -> Vec<&'a str>
Given a section of text, most likely containing multiple sentences, segment the text into translatable units.
sourcefn count_words(&self, segment: &str) -> usize
fn count_words(&self, segment: &str) -> usize
The amount of words in a particular segment
sourcefn count_characters(&self, segment: &str) -> usize
fn count_characters(&self, segment: &str) -> usize
The amount of non-whitespace characters in a particular segment
Implementors
impl SegmentationRules for UnicodeRules
The Segmentation rules implementation for UnicodeRules