示例#1
0
        static void Main(string[] args)
        {
            _corpus = Corpus.init();
            //_corpus.Empty().Wait();
            var crawler = new Crawler(_corpus);

            _querier = new Querier(_corpus);
            while (true)
            {
                var q = enterQuery();
                Console.Clear();
                Console.WriteLine("Entered: " + q);
                _querier.Query(q);
                Console.WriteLine("\nResults");
                Console.WriteLine("Approx. " + _querier.duration + "ms");
                foreach (var result in _querier.Results)
                {
                    Console.WriteLine();
                    Console.WriteLine("[" + result.Extension + "] - " + result.Title + " - " + result.Size + " bytes");
                    Console.WriteLine("at .../" + result.RelativePath);
                    Console.WriteLine(result.LastModified);
                    Console.WriteLine(result.Value);
                    Console.WriteLine();
                }
                Console.Write("Enter a Key to Keep Searching..");
                Console.ReadKey();
                Console.Clear();
            }
        }
示例#2
0
文件: Form1.cs 项目: Kooldeji/WebSpy
        public Form1()
        {
            InitializeComponent();

            _corpus = Corpus.init();
            var crawler = new Crawler(_corpus);

            _querier = new Querier(_corpus);

            _suggestMethod = new Func <string, CancellationTokenSource, HashSet <string> >(_querier.AutoCompleteWord);
            _queryMethod   = new QueryDelegate(_querier.Query);
        }
示例#3
0
 public void CorpusTest()
 {
     corpus = Corpus.init();
     corpus.Default().Wait();
 }