public void LoadTemplates(string path) { trie = new FootPrintTrie(); using (System.IO.StreamReader rdr = new System.IO.StreamReader(path)) { while (!rdr.EndOfStream) { string template = rdr.ReadLine(); if (template == null) { break; } template = template.Trim(); if (template.Length > 0) { string[] parts = template.Split('#'); string sample = parts[0].Trim(); List <string> tokens = sample.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList(); tokens.Add(FootPrintTrieNode.END_TOKEN); trie.AddSequence(tokens); } } } }
public bool Match(FootPrintTrie trie) { return(trie.Verify(tokens)); }