MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / get

Method get

pdf2zh/cache.py:78–84  ·  view source on GitHub ↗
(self, original_text: str)

Source from the content-addressed store, hash-verified

76 # Since peewee and the underlying sqlite are thread-safe,
77 # get and set operations don't need locks.
78 def get(self, original_text: str) -> Optional[str]:
79 result = _TranslationCache.get_or_none(
80 translate_engine=self.translate_engine,
81 translate_engine_params=self.translate_engine_params,
82 original_text=original_text,
83 )
84 return result.translation if result else None
85
86 def set(self, original_text: str, translation: str):
87 try:

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