mirror of
https://github.com/wassname/pysle.git
synced 2026-06-27 16:10:05 +08:00
BUGFIX: 'U' mode depreciated in open in favor of io.open
'U' is universal line support mode, which is the default mode in io.open
This commit is contained in:
+3
-1
@@ -4,6 +4,7 @@ Created on Oct 11, 2012
|
||||
@author: timmahrt
|
||||
'''
|
||||
|
||||
import io
|
||||
|
||||
vowelList = ['a', '@', 'e', 'i', 'o', 'u', '^', '&', '>', ]
|
||||
|
||||
@@ -30,7 +31,8 @@ class LexicalTool():
|
||||
Builds the isle textfile into a dictionary for fast searching
|
||||
'''
|
||||
lexDict = {}
|
||||
wordList = [line.rstrip('\n') for line in open(self.islePath, "rU")]
|
||||
with io.open(self.islePath, "r") as fd:
|
||||
wordList = [line.rstrip('\n') for line in fd]
|
||||
|
||||
for row in wordList:
|
||||
word, pronunciation = row.split(" ", 1)
|
||||
|
||||
Reference in New Issue
Block a user