public static IEnumerable <string> Search(string oriWord, int maxDist, TrieDictionary dict) { LenvstnNFA nfa = LenvstnNFA.BuildNFA(oriWord, maxDist); //nfa.Show(); LenvstnDFA dfa = SubsetMachine.SubsetConstruct(nfa); //dfa.Show(); List <string> output = new List <string>(); DFSserach(dfa, dfa.start, dict.Root, output); return(output); }
public static TrieDictionary BuildTrieDictionary(IEnumerator <string> it) { TrieDictionary trieDict = new TrieDictionary(); while (it.MoveNext()) { trieDict.AddTrieNode(it.Current); } return(trieDict); }