Skip to content

Commit 77c646b

Browse files
committed
Preinstall french data for running example
1 parent 1b04ab5 commit 77c646b

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ addons:
3030
- libtesseract-dev
3131
- libleptonica-dev
3232
- tesseract-ocr-eng
33+
- tesseract-ocr-fra
3334
- libpoppler-cpp-dev
3435
- libmagick++-dev
3536

R/tessdata.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
#' @param progress print progress while downloading
2727
#' @references [tesseract wiki: training data](https://github.com/tesseract-ocr/tesseract/wiki/Data-Files)
2828
#' @examples \donttest{
29-
#' tesseract_download("fra")
29+
#' if(is.na(match("fra", tesseract_info()$available)))
30+
#' tesseract_download("fra")
3031
#' french <- tesseract("fra")
3132
#' text <- ocr("https://jeroen.github.io/images/french_text.png", engine = french)
3233
#' cat(text)
3334
#' }
34-
tesseract_download <- function(lang, datapath = NULL, progress = TRUE){
35+
tesseract_download <- function(lang, datapath = NULL, progress = interactive()){
3536
if(!length(datapath)){
3637
warn_on_linux()
3738
datapath <- tesseract_info()$datapath

man/tessdata.Rd

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tesseract.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include "tesseract_types.h"
22
#include <tesseract/genericvector.h>
33

4-
/* NB: libtesseract now insists that the engine is loaded in 'C' locale.
4+
/* NB: libtesseract now insists that the engine is initiated in 'C' locale.
5+
* We do this as exemplified in the example code in the libc manual:
6+
* https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html
57
* Hopefully this is temporary and it will be fixed upstream.
68
* Full discussion: https://github.com/tesseract-ocr/tesseract/issues/1670
79
*/

0 commit comments

Comments
 (0)