예제 #1
0
        public void TriTest(string wordFilePath)
        {
            WordFileWrapper wfw = new WordFileWrapper(wordFilePath);
            Tri myTri = new Tri(wfw.GetAllWords());
            TriNavigator nav = myTri.GetNavigator();

            var x = 5;
        }
예제 #2
0
        public void TriTest(string wordFilePath)
        {
            WordFileWrapper wfw   = new WordFileWrapper(wordFilePath);
            Tri             myTri = new Tri(wfw.GetAllWords());
            TriNavigator    nav   = myTri.GetNavigator();

            var x = 5;
        }
예제 #3
0
 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;
 }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }