Example #1
0
        public void Run()
        {
            var fileIndex = new FileIndex();

            var fileNames = new List <string> {
                "ex1.txt", "ex2.txt", "ex3.txt", "ex4.txt"
            };

            foreach (var fileName in fileNames)
            {
                var @in   = new In($"Files\\Searching\\{fileName}");
                var words = @in.ReadAllStrings();
                fileIndex.CreateIndex(fileName, words);
            }


            fileIndex.ShowFilesByQuery("was");
            Console.WriteLine("------------------------------------");
            fileIndex.ShowFilesByQuery("age");
            Console.WriteLine("------------------------------------");
            fileIndex.ShowFilesByQuery("wisdom");



            Console.ReadLine();
        }