Browse Source

CLI: Ignore blank lines

master
Starbeamrainbowlabs 2 years ago
parent
commit
e9cc40f335
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      MarkovGrams/Program.cs

+ 3
- 0
MarkovGrams/Program.cs View File

@ -84,6 +84,9 @@ namespace MarkovGrams
IEnumerable<string> 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)


Loading…
Cancel
Save