MCPcopy Create free account
hub / github.com/EasyIME/PIME / __init__

Method __init__

python/cinbase/userphrase.py:9–32  ·  view source on GitHub ↗
(self, fs)

Source from the content-addressed store, hash-verified

7 encoding = 'utf-8'
8
9 def __init__(self, fs):
10
11 self.keynames = []
12 self.chardefs = {}
13
14 for line in fs:
15
16 line = line.strip()
17
18 key, root = safeSplit(line)
19 key = key.strip()
20
21 rootlist = rootSplit(root)
22
23 if len(rootlist) > 0:
24 for rootstr in rootlist:
25 stripstr = rootstr.strip()
26 try:
27 self.chardefs[key].append(stripstr)
28 except KeyError:
29 self.chardefs[key] = [stripstr]
30
31 if key not in self.keynames:
32 self.keynames.append(key)
33
34 def __del__(self):
35 del self.keynames

Callers

nothing calls this directly

Calls 3

safeSplitFunction · 0.70
rootSplitFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected