Trait tokenizers::tokenizer::pattern::Pattern

source ·
pub trait Pattern {
    // Required method
    fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>;
}
Expand description

Pattern used to split a NormalizedString

Required Methods§

source

fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>

Slice the given string in a list of pattern match positions, with a boolean indicating whether this is a match or not.

This method must cover the whole string in its outputs, with contiguous ordered slices.

Implementations on Foreign Types§

source§

impl Pattern for &str

source§

fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>

source§

impl Pattern for &String

source§

fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>

source§

impl Pattern for &Regex

source§

fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>

source§

impl Pattern for &Regex

source§

fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>

source§

impl Pattern for char

source§

fn find_matches(&self, inside: &str) -> Result<Vec<(Offsets, bool)>>

Implementors§

source§

impl Pattern for &SysRegex

source§

impl<F> Pattern for F
where F: Fn(char) -> bool,

source§

impl<P: Pattern> Pattern for Invert<P>