/// Create a new instance for a given pattern.
Create a new instance for a given pattern.
Create a new instance for a given pattern .
pub fn new<C, P>(pattern: P) -> Self
    where
        C: Borrow<u8>,
        P: IntoIterator<Item = C>,
        P::IntoIter: DoubleEndedIterator + ExactSizeIterator,
    {
        let pattern = pattern.into_iter();
        let m = pattern.len();
        assert!(m <= 64, "Expecting a pattern of at most 64 symbols.");
        // take the reverse pattern and build nondeterministic
        // suffix automaton
        let (masks, accept) = masks(pattern.rev());
        BNDM { m, masks, accept }
    }
pub fn new < C , P > ( pattern : P ) -> Self where C : Borrow < u8 > , P : IntoIterator < Item = C > , P :: IntoIter : DoubleEndedIterator + ExactSizeIterator , { let pattern = pattern . into_iter ( ) ; let m = pattern . len ( ) ; assert ! ( m 64 " " ) ; // take the reverse pattern and build nondeterministic // suffix automaton let ( masks , accept ) = masks ( pattern . rev ( ) ) ; BNDM { m , masks , accept } }
Create a new instance for a given pattern.
Create a new instance for a given pattern .
pattern
P