コード例 #1
0
        public void getTermsTest()
        {
            CorpusTest();
            var res = corpus.GetTerms();

            res.Wait();
            foreach (var i in res.Result)
            {
                Console.WriteLine(i);
            }
        }
コード例 #2
0
        private static async Task printPredict(string v, int max)
        {
            var pattern = new Regex(v + ".*");
            var terms   = await _corpus.GetTerms(term => {
                return(pattern.IsMatch(term));
                //if (term.Count() >= v.Count())
                //{
                //    return String.Compare(v, term.Substring(0, v.Count()), true) == 0;
                //}
                //return false;
            }, max);

            Console.WriteLine();
            foreach (var term in terms)
            {
                Console.WriteLine(term);
            }
        }