build_trie

Function build_trie 

Source
pub fn build_trie(
    patterns: &[&[u8]],
    excluded_patterns: &[&[u8]],
    allow_overlap: bool,
    add_back_edges: bool,
) -> Option<TrieBuildResult>
Expand description

Build a trie-based FSM.

patterns are inserted as a character trie. excluded_patterns are only honored when add_back_edges is true (the trie becomes an Aho-Corasick automaton with the excluded terminals pruned).

Returns None when allow_overlap is false and a pattern is empty or is a prefix of / shares a terminal with another pattern.