MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / setUp

Method setUp

src/main/pp-ocr.ts:100–118  ·  view source on GitHub ↗
(config: { cwd: string; config_name: string })

Source from the content-addressed store, hash-verified

98 }
99
100 setUp(config: { cwd: string; config_name: string }) {
101 if (!examToken(config)) {
102 return;
103 }
104 const { cwd, config_name } = config;
105 this.worker = new PPOCRWorker(
106 "PaddleOCR_json.exe",
107 [`--config_path=${config_name}`],
108 {
109 cwd: cwd,
110 },
111 false
112 );
113 this.worker.on("error", () => {
114 this.worker = null;
115 console.log("PP OCR初始化失败");
116 logger.toast("PP OCR initialize fail.", true);
117 });
118 }
119
120 onExit() {
121 if (this.enabled()) {

Callers

nothing calls this directly

Calls 3

examTokenFunction · 0.90
onMethod · 0.80
toastMethod · 0.80

Tested by

no test coverage detected