MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / parse_dict

Function parse_dict

data/scripts/opencc_resources_zip_diff.py:60–69  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

58
59
60def parse_dict(text):
61 result = {}
62 for line in text.splitlines():
63 if not line.strip() or line.lstrip().startswith("#"):
64 continue
65 if "\t" not in line:
66 continue
67 key, value = line.split("\t", 1)
68 result[key] = value
69 return result
70
71
72def dictionary_summary(before_text, after_text):

Callers 2

dictionary_summaryFunction · 0.85
dictionary_file_summaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected