Struct aho_corasick::AcAutomaton [] [src]

pub struct AcAutomaton<T = Dense> {
    // some fields omitted
}

An Aho-Corasick finite automaton.

Methods

impl AcAutomaton
[src]

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>
[src]

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: Clone> Clone for AcAutomaton<T>
[src]

fn clone(&self) -> AcAutomaton<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: Transitions> Automaton for AcAutomaton<T>
[src]

fn next_state(&self, si: StateIdx, b: u8) -> StateIdx

Return the next state given the current state and next character.

fn get_match(&self, si: StateIdx, outi: usize, texti: usize) -> Match

Build a match given the current state, pattern index and input index.

fn has_match(&self, si: StateIdx, outi: usize) -> bool

Return true if and only if the given state and current pattern index indicate a match. Read more

fn skip_to(&self, si: StateIdx, text: &[u8], at: usize) -> usize

Attempt to skip through the input. Read more

fn is_skippable(&self) -> bool

Returns true if and only if this automaton can skip through the input.

fn patterns(&self) -> &[String]

Returns all of the patterns matched by this automaton. Read more

fn pattern(&self, i: usize) -> &str

Returns the pattern indexed at i. Read more

fn len(&self) -> usize

Return the number of patterns in the automaton.

fn is_empty(&self) -> bool

Returns true if the automaton has no patterns.

fn find<'a, 's>(&'a self, s: &'s str) -> Matches<'a, 's, Self>

Returns an iterator of non-overlapping matches in s.

fn find_overlapping<'a, 's>(&'a self, s: &'s str) -> MatchesOverlapping<'a, 's, Self>

Returns an iterator of overlapping matches in s.

fn stream_find<'a, R: Read>(&'a self, rdr: R) -> StreamMatches<'a, R, Self>

Returns an iterator of non-overlapping matches in the given reader.

fn stream_find_overlapping<'a, R: Read>(&'a self, rdr: R) -> StreamMatchesOverlapping<'a, R, Self>

Returns an iterator of overlapping matches in the given reader.

impl<S: Into<String>> FromIterator<S> for AcAutomaton
[src]

fn from_iter<T>(it: T) -> AcAutomaton where T: IntoIterator<Item=S>

Create an automaton from an iterator of strings.

impl<T: Transitions> Debug for AcAutomaton<T>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.