From 471065b623dd46732ef09d3a40abf576a0e623c7 Mon Sep 17 00:00:00 2001 From: Robin Windey Date: Sat, 21 May 2022 13:12:14 +0200 Subject: [PATCH] Add chinese simplified (#120) Closing #119 --- README.md | 3 +++ lib/OcrProcessors/PdfOcrProcessor.php | 3 ++- src/components/WorkflowOcr.vue | 1 + src/test/components/WorkflowOcr.spec.js | 4 ++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a579d6..3dd09f8 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ apt-get install tesseract-ocr-eng # German apt-get install tesseract-ocr-deu + +# Chinese - Simplified +apt-get install tesseract-ocr-chi-sim ``` ## Usage diff --git a/lib/OcrProcessors/PdfOcrProcessor.php b/lib/OcrProcessors/PdfOcrProcessor.php index c4fc69b..252ed77 100644 --- a/lib/OcrProcessors/PdfOcrProcessor.php +++ b/lib/OcrProcessors/PdfOcrProcessor.php @@ -42,7 +42,8 @@ class PdfOcrProcessor implements IOcrProcessor { 'it' => 'ita', 'es' => 'spa', 'pt' => 'por', - 'ru' => 'rus' + 'ru' => 'rus', + 'chi' => 'chi_sim' ]; /** @var ICommand */ diff --git a/src/components/WorkflowOcr.vue b/src/components/WorkflowOcr.vue index 084183f..96c099d 100644 --- a/src/components/WorkflowOcr.vue +++ b/src/components/WorkflowOcr.vue @@ -52,6 +52,7 @@ const availableLanguages = [ { label: 'Spanish', langCode: 'es' }, { label: 'Portuguese', langCode: 'pt' }, { label: 'Russian', langCode: 'ru' }, + { label: 'Chinese - Simplified', langCode: 'chi' }, ] export default { diff --git a/src/test/components/WorkflowOcr.spec.js b/src/test/components/WorkflowOcr.spec.js index 93b5e03..14158f6 100644 --- a/src/test/components/WorkflowOcr.spec.js +++ b/src/test/components/WorkflowOcr.spec.js @@ -15,9 +15,9 @@ describe('Init tests', () => { }) describe('Language settings tests', () => { - test('Should have 7 languages available', () => { + test('Should have 8 languages available', () => { const wrapper = mount(WorkflowOcr) - expect(wrapper.vm.availableLanguages.length).toBe(7) + expect(wrapper.vm.availableLanguages.length).toBe(8) }) test('Should select one language', () => {