Revert "fix: ReferenceError: regeneratorRuntime is not defined"

This reverts commit 84edc08928.

Revert "fix ocr can't recognize chinese characters"

This reverts commit 116cebaea4.
This commit is contained in:
wuyingren 2020-04-05 23:32:54 +08:00
parent 84edc08928
commit 88290b9f5e
5 changed files with 5 additions and 10 deletions

View file

@ -224,16 +224,11 @@ class FocalPointModal extends ImmutablePureComponent {
}
}
worker.loadLanguage('eng+chi_sim+chi_sim_vert+chi_tra+chi_tra_vert')
.then(() => worker.initialize('eng+chi_sim+chi_tra')
.then(() => {
worker.recognize(media_url)
.progress(({ progress }) => this.setState({ progress }))
.finally(() => worker.terminate())
.then(({ text }) => this.setState({ description: removeExtraLineBreaks(text), dirty: true, detecting: false }))
.catch(() => this.setState({ detecting: false }));
})
);
worker.recognize(media_url)
.progress(({ progress }) => this.setState({ progress }))
.finally(() => worker.terminate())
.then(({ text }) => this.setState({ description: removeExtraLineBreaks(text), dirty: true, detecting: false }))
.catch(() => this.setState({ detecting: false }));
}).catch(() => this.setState({ detecting: false }));
}