static void Main(string[] args) { var path = "book.txt"; if (args.Length > 0) { path = args[0]; } var numberOfWords = 10; if (args.Length > 1) { numberOfWords = int.Parse(args[1]); } var reader = new BookReader() .Take(path) .Read() .RemoveAlphaNumerical(); var words = new Interpreter() .Take(reader.Book) .MostFrequentWords(10); Console.Write("{ "); foreach (var word in words) { Console.Write(word + ' '); } Console.WriteLine("}"); }
public void ReadsCorrectly() { var reader = new BookReader { Path = "book.txt" }; var book = reader .Read() .RemoveAlphaNumerical() .Book; Assert.IsFalse(string.IsNullOrEmpty(book)); }