branch: externals/scanner commit 440a32484dfb67430d638099c1700190942da0c3 Author: Raffael Stocker <r.stoc...@mnet-mail.de> Commit: Raffael Stocker <r.stoc...@mnet-mail.de>
Revert "make use of --tessdata-dir compatible with tesseract v4" This reverts commit f1a7256a56090a58b7f7a6d17d24994a132fe705. --- scanner-test.el | 9 ++------- scanner.el | 11 ++++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/scanner-test.el b/scanner-test.el index 7c8a7ac..a88d67c 100644 --- a/scanner-test.el +++ b/scanner-test.el @@ -141,7 +141,6 @@ (scanner-tesseract-languages '("eng" "deu")) (scanner-tesseract-switches '("--opt1" "--opt2")) (scanner-tesseract-outputs '("out1" "out2")) - (scanner-tessdata-dir "/usr/share") (-compare-fn #'string=)) (should (-is-infix-p '("-l" "eng+deu") (scanner--tesseract-args "infile" "outfile"))) @@ -150,17 +149,13 @@ "outfile")))) (let ((scanner--tesseract-v4 "1000")) (should-not (-is-infix-p '("--dpi" "300") (scanner--tesseract-args "infile" - "outfile")))) + "outfile")))) (should (-contains-p (scanner--tesseract-args "infile" "outfile") "--opt1")) (should (-contains-p (scanner--tesseract-args "infile" "outfile") "--opt2")) (should (-contains-p (scanner--tesseract-args "infile" "outfile") "infile")) (should (-contains-p (scanner--tesseract-args "infile" "outfile") "outfile")) (should (-contains-p (scanner--tesseract-args "infile" "outfile") "out1")) - (should (-contains-p (scanner--tesseract-args "infile" "outfile") "out2")) - (should (-contains-p (scanner--tesseract-args "infile" "outfile") - "--tessdata-dir=/usr/share")) - (should-not (-is-infix-p '("--tessdata-dir" "/usr/share") - (scanner--tesseract-args "infile" "outfile"))))) + (should (-contains-p (scanner--tesseract-args "infile" "outfile") "out2")))) ;; Note: interactive commands are only tested for their non-interactive ;; behavior diff --git a/scanner.el b/scanner.el index 752bd49..b4cad60 100644 --- a/scanner.el +++ b/scanner.el @@ -164,8 +164,8 @@ widget's values and the elements of SET." (condition-case err (cdr (process-lines scanner-tesseract-program "--list-langs" - (concat "--tessdata-dir=" - scanner-tessdata-dir))) + "--tessdata-dir" + scanner-tessdata-dir)) (error (error "No language definitions found %s" (cdr err)))))) (defcustom scanner-tesseract-languages @@ -357,7 +357,8 @@ extensions depending on the selected output options, see (list "--dpi" (number-to-string (plist-get scanner-resolution :doc)))) scanner-tesseract-switches - (concat "--tessdata-dir=" scanner-tessdata-dir) + "--tessdata-dir" + scanner-tessdata-dir scanner-tesseract-outputs))) (defun scanner--ensure-init () @@ -454,8 +455,8 @@ them. Otherwise, return nil." (cl-assert scanner-tesseract-program) (cdr (process-lines scanner-tesseract-program "--list-langs" - (concat "--tessdata-dir=" - scanner-tessdata-dir)))) + "--tessdata-dir" + scanner-tessdata-dir))) (error (error "Could not query language list %s" (cdr err)))))) (list (completing-read-multiple "Languages: " langs nil t))))