示例#1
0
        public void TestSingleBook()
        {
            ReadAndInsert readAndInsert = new ReadAndInsert();
            var           townlist      = readAndInsert.GetTownList();
            var           book          = File.ReadAllText("book\\17.txt");

            var listSentences = readAndInsert.GetPotentialTownSentences(book, townlist);

            Assert.Equal(2, listSentences.Count);
        }
示例#2
0
        public void TestAllBooks()
        {
            ReadAndInsert readAndInsert = new ReadAndInsert();
            var           townlist      = readAndInsert.GetTownList();

            var       files = Directory.GetFiles("book");
            Stopwatch sw    = new Stopwatch();

            sw.Start();
            foreach (var file in files)
            {
                var book = File.ReadAllText(file);

                var listSentences = readAndInsert.GetPotentialTownSentences(book, townlist);
            }

            sw.Stop();
            Console.WriteLine($"Found sentences in {sw.Elapsed}");
        }