BUGFIX: Was unable to read islev2.txt with trailing newline

My custom islev2.txt did not have a trailing newline.
This commit is contained in:
timmahrt
2015-06-11 15:43:27 -05:00
parent 06222bf176
commit c10e3cf05f
+2 -1
View File
@@ -30,7 +30,8 @@ class LexicalTool():
Builds the isle textfile into a dictionary for fast searching
'''
lexDict = {}
wordList = open(self.islePath, "r").read().split("\n")
wordList = [line.rstrip('\n') for line in open(self.islePath, "rU")]
for row in wordList:
word, pronunciation = row.split(" ", 1)
word = word.split("(")[0]