diff --git a/MarkovGrams/Program.cs b/MarkovGrams/Program.cs index 2d3134d..1380786 100644 --- a/MarkovGrams/Program.cs +++ b/MarkovGrams/Program.cs @@ -84,6 +84,9 @@ namespace MarkovGrams IEnumerable words = wordlistSource.ReadAllLines().SelectMany((string word) => { word = word.Trim(); + // No blank lines here! + if (string.IsNullOrWhiteSpace(word)) return new string[] { }; + if (convertLowercase) word = word.ToLower(); if (splitOnWhitespace)