diff --git a/chapter8/3-markovGenerator.py b/chapter8/3-markovGenerator.py index 292f252..e19dd33 100644 --- a/chapter8/3-markovGenerator.py +++ b/chapter8/3-markovGenerator.py @@ -26,9 +26,7 @@ def buildWordDict(text): for symbol in punctuation: text = text.replace(symbol, " "+symbol+" ") - words = text.split(" ") - #Filter out empty words - words = [word for word in words if word != ""] + words = text.split() wordDict = {} for i in range(1, len(words)):