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

Method convert

python/opencc/__init__.py:38–46  ·  view source on GitHub ↗
(self, from_str)

Source from the content-addressed store, hash-verified

36 print(self.opencc)
37
38 def convert(self, from_str):
39 result = ""
40 input_data = bytes(from_str, "UTF-8")
41 result_p = _libopencc.opencc_convert_utf8(self.opencc, input_data, len(input_data))
42 print(result_p)
43 if result_p:
44 result = c_char_p(result_p).value.decode("UTF-8")
45 _libopencc.opencc_convert_utf8_free(result_p)
46 return result
47
48 def get_error(self):
49 return _libopencc.opencc_error()

Callers 6

onKeyDownMethod · 0.45
setOutputStringMethod · 0.45
get_schema_listMethod · 0.45
config_get_menuMethod · 0.45
onKeyDownMethod · 0.45
compositionModeFunction · 0.45

Calls 1

printFunction · 0.50

Tested by

no test coverage detected