Exemple #1
0
        public InvertedIndexSearchTest()
        {
            var contents = new Dictionary <string, string>();

            contents.Add("testData1.txt", "hello hello world..");
            contents.Add("testData2.txt", "foo?  i bars!!! him");
            contents.Add("testData3.txt", "Freedom is only a hallucination.");
            this.invertedIndexSearch = new InvertedIndexSearch(contents);
        }
        static void Main(string[] args)
        {
            var invertedIndexSearch = new InvertedIndexSearch(new SearchContext(SERVER), false);

            while (true)
            {
                System.Console.WriteLine((WELCOME_MASSAGE));
                var inputString = System.Console.ReadLine();
                if (inputString.Equals(EXIT_COMMAND))
                {
                    break;
                }
                System.Console.WriteLine(invertedIndexSearch.Search(inputString));
            }
        }
        static void Main(string[] args)
        {
            var fileReader          = new FileReader(DATA_PATH);
            var fileContents        = fileReader.ReadContent();
            var invertedIndexSearch = new InvertedIndexSearch(fileContents);

            while (true)
            {
                System.Console.WriteLine((WELCOME_MASSAGE));
                var inputString = System.Console.ReadLine();
                if (inputString.Equals(EXIT_COMMAND))
                {
                    break;
                }
                System.Console.WriteLine(invertedIndexSearch.Search(inputString));
            }
        }