コード例 #1
0
ファイル: Program.cs プロジェクト: alidragon/Capstone2015
        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");
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: alidragon/Capstone2015
        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");
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: alidragon/Capstone2015
        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);
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: alidragon/Capstone2015
        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);
            }
        }