From 0ddbf9dfb344999c1f64753245580d89eff8750e Mon Sep 17 00:00:00 2001 From: Megan Will Date: Fri, 1 Mar 2019 14:45:11 -0600 Subject: [PATCH 1/5] spelling correction --- includes/utilities.inc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/includes/utilities.inc b/includes/utilities.inc index 806caa4..fe2a67a 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -99,14 +99,16 @@ function islandora_ocr_get_tesseract_installed_languages($tesseract = NULL) { */ function islandora_ocr_tesseract_language_name($language) { $language_names = array( - 'eng' => t('English'), - 'fra' => t('French'), - 'deu-frak' => t('German'), - 'por' => t('Portugese'), - 'spa' => t('Spanish'), - 'hin' => t('Hindi'), - 'jpn' => t('Japanese'), - 'ita' => t('Italian'), + 'eng' => t('English'), + 'fra' => t('French'), + 'deu-frak' => t('German - Fraktur'), + 'por' => t('Portuguese'), + 'spa' => t('Spanish'), + 'hin' => t('Hindi'), + 'jpn' => t('Japanese'), + 'ita' => t('Italian'), + 'lat' => t('Latin'), + 'deu' => t('German') ); return isset($language_names[$language]) ? $language_names[$language] : $language; } From 0bfa7f3861b1b68015c120c782d9f41c53bc1f5f Mon Sep 17 00:00:00 2001 From: Megan Will Date: Fri, 1 Mar 2019 16:24:03 -0600 Subject: [PATCH 2/5] hook for human readable names of tesseract abbreviations --- includes/utilities.inc | 27 +++++++++++++++------------ islandora_ocr.api.php | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 islandora_ocr.api.php diff --git a/includes/utilities.inc b/includes/utilities.inc index fe2a67a..daad808 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -98,18 +98,21 @@ function islandora_ocr_get_tesseract_installed_languages($tesseract = NULL) { * otherwise the abbreviation is returned unaltered. */ function islandora_ocr_tesseract_language_name($language) { - $language_names = array( - 'eng' => t('English'), - 'fra' => t('French'), - 'deu-frak' => t('German - Fraktur'), - 'por' => t('Portuguese'), - 'spa' => t('Spanish'), - 'hin' => t('Hindi'), - 'jpn' => t('Japanese'), - 'ita' => t('Italian'), - 'lat' => t('Latin'), - 'deu' => t('German') - ); + $language_names = module_invoke_all('get_ocr_tesseract_languages'); + if (is_null($language_names)){ + $language_names = array( + 'eng' => t('English'), + 'fra' => t('French'), + 'deu-frak' => t('German - Fraktur'), + 'por' => t('Portuguese'), + 'spa' => t('Spanish'), + 'hin' => t('Hindi'), + 'jpn' => t('Japanese'), + 'ita' => t('Italian'), + 'lat' => t('Latin'), + 'deu' => t('German') + ); + } return isset($language_names[$language]) ? $language_names[$language] : $language; } diff --git a/islandora_ocr.api.php b/islandora_ocr.api.php new file mode 100644 index 0000000..1cfe880 --- /dev/null +++ b/islandora_ocr.api.php @@ -0,0 +1,37 @@ + t('Swahili'), + 'swe' => t('Swedish'), + 'syr' => t('Syriac'), + 'tam' => t('Tamil'), + 'tel' => t('Telugu'), + 'tgk' => t('Tajik'), + 'tgl' => t('Tagalog'), + 'tha' => t('Thai'), + 'tir' => t('Tigrinya'), + 'tur' => t('Turkish'), + 'uig' => t('Uighur; Uyghur'), + 'ukr' => t('Ukrainian'), + 'urd' => t('Urdu'), + 'uzb' => t('Uzbek'), + 'uzb_cyrl' => t('Uzbek - Cyrillic'), + 'vie' => t('Vietnamese'), + 'yid' => t('Yiddish'), + ); +} From 25a59d902c5ac315a74ba42d99bbecf8a01c34ff Mon Sep 17 00:00:00 2001 From: Megan Will Date: Fri, 1 Mar 2019 17:28:59 -0600 Subject: [PATCH 3/5] cleaning help text --- .idea/encodings.xml | 4 + .idea/islandora_ocr.iml | 8 ++ .idea/misc.xml | 6 + .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + .idea/workspace.xml | 248 ++++++++++++++++++++++++++++++++++++++++ islandora_ocr.api.php | 1 - 7 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 .idea/encodings.xml create mode 100644 .idea/islandora_ocr.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/islandora_ocr.iml b/.idea/islandora_ocr.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/islandora_ocr.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d05d327 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..0a95f5e --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sdc + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - 1551472922063 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From cbd28612b1673432d37363061faa00e5b773c3b2 Mon Sep 17 00:00:00 2001 From: Meg Will Date: Wed, 13 Mar 2019 09:59:10 -0500 Subject: [PATCH 5/5] needed space --- includes/utilities.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/utilities.inc b/includes/utilities.inc index daad808..4efc406 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -99,7 +99,7 @@ function islandora_ocr_get_tesseract_installed_languages($tesseract = NULL) { */ function islandora_ocr_tesseract_language_name($language) { $language_names = module_invoke_all('get_ocr_tesseract_languages'); - if (is_null($language_names)){ + if (is_null($language_names)) { $language_names = array( 'eng' => t('English'), 'fra' => t('French'),