Esempio n. 1
0
        public static void BuildContentTreeGoodMatches()
        {
            ITreeIO tio = new TreeIO();
            WordSuggestor ws = tio.LoadObject(testpath + "WordSuggestions") as WordSuggestor;

            IBaseTree tree = ws.BuildTreeGoodMatches();
            tio.SaveBaseTree(tree, testpath + "AutoTree2.tree");
        }
Esempio n. 2
0
        public static void BuildSuggestor()
        {
            IIO io = new FileIO();
            IEnumerable<string> file = io.ReadSourceIterable(testpath + "TIME.ALL");
            ITextExtractor it = new BeginMarkerExtraction(file, "*TEXT");

            Console.WriteLine("Building suggestion base");
            WordSuggestor ws = new WordSuggestor();
            ws.addAll(it);
            Console.WriteLine("Saving tree");
            ITreeIO tio = new TreeIO();
            tio.SaveObject(ws, testpath + "WordSuggestions");
        }
Esempio n. 3
0
        public static void TestSuggestions()
        {
            IIO io = new FileIO();
            IEnumerable<string> file = io.ReadSourceIterable(testpath + "TIME.ALL");
            ITextExtractor it = new BeginMarkerExtraction(file, "*TEXT");

            WordSuggestor ws = new WordSuggestor();
            ws.AddAllStemmed(it);
            var words = ws.Suggestions(.2);
            foreach (string s in words) {
                Console.WriteLine(s);
            }
        }
Esempio n. 4
0
        public static void TestWordSuggestions()
        {
            IIO io = new FileIO();
            IEnumerable<string> file = io.ReadSourceIterable(testpath + "TIME.ALL");
            ITextExtractor it = new BeginMarkerExtraction(file, "*TEXT");

            Console.WriteLine("Building suggestion base");
            WordSuggestor ws = new WordSuggestor();
            ws.AddAllStemmed(it);
            string test = "embassi";
            Console.WriteLine("Determining suggestions for '" + test + "':");
            var words = ws.WordSuggestions(test, .2);
            foreach (string s in words) {
                Console.WriteLine(s);
            }
        }