public void TriTest(string wordFilePath) { WordFileWrapper wfw = new WordFileWrapper(wordFilePath); Tri myTri = new Tri(wfw.GetAllWords()); TriNavigator nav = myTri.GetNavigator(); var x = 5; }
public static HashSet<string> WordsInCharBuffer(char[] carr, Tri possibleWords) { HashSet<string> retStore = new HashSet<string>(); for(long i = 0; i < carr.Length; i++) { TriNavigator nav = possibleWords.GetNavigator(); long initalLength = 1; string initialStr = ""; RecurseFromCurrent(carr, i, initalLength, nav, initialStr, retStore); } return retStore; }
public static HashSet <string> WordsInCharBuffer(char[] carr, Tri possibleWords) { HashSet <string> retStore = new HashSet <string>(); for (long i = 0; i < carr.Length; i++) { TriNavigator nav = possibleWords.GetNavigator(); long initalLength = 1; string initialStr = ""; RecurseFromCurrent(carr, i, initalLength, nav, initialStr, retStore); } return(retStore); }
public void WordsInFile(string path_to_target_file, string path_to_file_containing_all_words) { byte[] buffer; using (FileStream fs = new FileStream(path_to_target_file, FileMode.Open)) { buffer = new byte[fs.Length]; fs.Read(buffer, 0, (int)fs.Length); } buffer = BufferUtils.RemoveNonAscii(buffer); char[] carr = BufferUtils.BytesToChars(buffer); WordFileWrapper wfw = new WordFileWrapper(path_to_file_containing_all_words); Tri tri = new Tri(wfw.GetAllWords()); HashSet<string> allWords = Algo.WordsInCharBuffer(carr, tri); Output(allWords); }
public void WordsInFile(string path_to_target_file, string path_to_file_containing_all_words) { byte[] buffer; using (FileStream fs = new FileStream(path_to_target_file, FileMode.Open)) { buffer = new byte[fs.Length]; fs.Read(buffer, 0, (int)fs.Length); } buffer = BufferUtils.RemoveNonAscii(buffer); char[] carr = BufferUtils.BytesToChars(buffer); WordFileWrapper wfw = new WordFileWrapper(path_to_file_containing_all_words); Tri tri = new Tri(wfw.GetAllWords()); HashSet <string> allWords = Algo.WordsInCharBuffer(carr, tri); Output(allWords); }