We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6b1d898 + 7cfd9a0 commit 13cab51Copy full SHA for 13cab51
exts/smallseg.py
@@ -16,8 +16,10 @@ def __init__(self):
16
curpath=_curpath
17
self.d = {}
18
print("loading dict...", file=sys.stderr)
19
- self.set([x.rstrip() for x in file(os.path.join(curpath,"main.dic")) ])
20
- self.specialwords= set([x.rstrip().decode('utf-8') for x in file(os.path.join(curpath,"suffix.dic"))])
+ with open(os.path.join(curpath, "main.dic")) as in_file:
+ self.set([x.rstrip() for x in in_file])
21
+ with open(os.path.join(curpath,"suffix.dic")) as in_file:
22
+ self.specialwords= set([x.rstrip().decode('utf-8') for x in in_file])
23
print('dict ok.', file=sys.stderr)
24
#set dictionary(a list)
25
def set(self,keywords):
0 commit comments