MCPcopy Index your code
hub / github.com/clips/pattern / add_code2cid

Method add_code2cid

pattern/web/pdf/cmapdb.py:147–160  ·  view source on GitHub ↗
(self, code, cid)

Source from the content-addressed store, hash-verified

145 return
146
147 def add_code2cid(self, code, cid):
148 assert isinstance(code, str) and isinstance(cid, int)
149 d = self.code2cid
150 for c in code[:-1]:
151 c = ord(c)
152 if c in d:
153 d = d[c]
154 else:
155 t = {}
156 d[c] = t
157 d =t
158 c = ord(code[-1])
159 d[c] = cid
160 return
161
162
163## FileUnicodeMap

Callers 1

do_keywordMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected