Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions exts/smallseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def __init__(self):
curpath=_curpath
self.d = {}
print("loading dict...", file=sys.stderr)
self.set([x.rstrip() for x in file(os.path.join(curpath,"main.dic")) ])
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])
with open(os.path.join(curpath,"suffix.dic")) as in_file:
self.specialwords= set([x.rstrip().decode('utf-8') for x in in_file])
print('dict ok.', file=sys.stderr)
#set dictionary(a list)
def set(self,keywords):
Expand Down