[ocrfeeder] Add the language option for the CLI version



commit f57ffaf1ef8411bbfc17707dc50408c9a3228026
Author: Joaquim Rocha <me joaquimrocha com>
Date:   Tue Feb 5 22:35:13 2013 -0800

    Add the language option for the CLI version

 bin/ocrfeeder-cli.in |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/bin/ocrfeeder-cli.in b/bin/ocrfeeder-cli.in
index 4fae83e..d15272f 100644
--- a/bin/ocrfeeder-cli.in
+++ b/bin/ocrfeeder-cli.in
@@ -72,6 +72,9 @@ parser.add_option('-o', '--output', dest = 'output',
 parser.add_option('-e', '--engine', dest = 'engine',
                   action = 'store', type = 'string',
                   help = ocr_engines_help_text)
+parser.add_option('-l', '--language', dest = 'language',
+                  action = 'store', type = 'string',
+                  help = 'the language according to the ISO-639-1. For example "pt" for Portuguese or "en" for English')
 parser.add_option('--window-size', dest = 'window_size', default = 'auto',
                   action = 'store', type = 'string', metavar= 'auto or an integer value',
                   help = 'the segmentation algorithm window size')
@@ -115,6 +118,9 @@ if engine_name:
 else:
     ocr_engine = ocr_engines[0][0]
 
+if options.language:
+    ocr_engine.setLanguage(options.language)
+
 pages = []
 for image in images:
     if not os.path.isfile(image):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]