Struct aho_corasick::AcAutomaton
[-] [+]
[src]
pub struct AcAutomaton<T = Dense> { // some fields omitted }
An Aho-Corasick finite automaton.
Methods
impl AcAutomaton
fn new<S, I>(pats: I) -> AcAutomaton<Dense> where S: Into<String>, I: IntoIterator<Item=S>
Create a new automaton from an iterator of patterns.
The patterns must be convertible to Unicode String
values via the
Into
trait.
impl<T: Transitions> AcAutomaton<T>
fn with_transitions<S, I>(pats: I) -> AcAutomaton<T> where S: Into<String>, I: IntoIterator<Item=S>
Create a new automaton from an iterator of patterns.
This constructor allows one to choose the transition representation.
The patterns must be convertible to Unicode String
values via the
Into
trait.
fn into_full(self) -> FullAcAutomaton
Build out the entire automaton into a single matrix.
This will make searching as fast as possible at the expense of using
at least 4 * 256 * #states
bytes of memory.
Trait Implementations
impl<T: Transitions> Automaton for AcAutomaton<T>
fn next_state(&self, si: StateIdx, b: u8) -> StateIdx
fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match
fn has_match(&self, si: StateIdx, outi: usize) -> bool
fn skip_to(&self, si: StateIdx, text: &[u8], at: usize) -> usize
fn is_skippable(&self) -> bool
fn patterns(&self) -> &[String]
fn pattern(&self, i: usize) -> &str
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn find<'a, 's>(&'a self, s: &'s str) -> Matches<'a, 's, Self>
fn find_overlapping<'a, 's>(&'a self, s: &'s str) -> MatchesOverlapping<'a, 's, Self>
fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, Self>
fn stream_find_overlapping<'a, R: Read>(&'a self, rdr: R) -> StreamMatchesOverlapping<'a, R, Self>
impl<S: Into<String>> FromIterator<S> for AcAutomaton
fn from_iter<T>(it: T) -> AcAutomaton where T: IntoIterator<Item=S>
Create an automaton from an iterator of strings.