MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / set

Method set

pdf2zh/cache.py:86–95  ·  view source on GitHub ↗
(self, original_text: str, translation: str)

Source from the content-addressed store, hash-verified

84 return result.translation if result else None
85
86 def set(self, original_text: str, translation: str):
87 try:
88 _TranslationCache.create(
89 translate_engine=self.translate_engine,
90 translate_engine_params=self.translate_engine_params,
91 original_text=original_text,
92 translation=translation,
93 )
94 except Exception as e:
95 logger.debug(f"Error setting cache: {e}")
96
97
98def init_db(remove_exists=False):

Callers 7

test_basic_set_getMethod · 0.95
test_cache_overwriteMethod · 0.95
test_append_paramsMethod · 0.95

Calls

no outgoing calls

Tested by 7

test_basic_set_getMethod · 0.76
test_cache_overwriteMethod · 0.76
test_append_paramsMethod · 0.76