mirror of
https://github.com/wassname/pysle.git
synced 2026-06-27 16:10:05 +08:00
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:
+2
-1
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user