Struct aho_corasick::AcAutomaton
[−]
[src]
pub struct AcAutomaton<P, T = Dense> { // some fields omitted }
An Aho-Corasick finite automaton.
The type parameter P
is the type of the pattern that was used to
construct this AcAutomaton.
Methods
impl<P: AsRef<[u8]>> AcAutomaton<P>
fn new<I>(pats: I) -> AcAutomaton<P, Dense> where I: IntoIterator<Item=P>
Create a new automaton from an iterator of patterns.
The patterns must be convertible to bytes (&[u8]
) via the AsRef
trait.
impl<P: AsRef<[u8]>, T: Transitions> AcAutomaton<P, T>
fn with_transitions<I>(pats: I) -> AcAutomaton<P, T> where I: IntoIterator<Item=P>
Create a new automaton from an iterator of patterns.
This constructor allows one to choose the transition representation.
The patterns must be convertible to bytes (&[u8]
) via the AsRef
trait.
fn into_full(self) -> FullAcAutomaton<P>
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.