[ 
https://issues.apache.org/jira/browse/TIKA-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283297#comment-17283297
 ] 

Tim Allison commented on TIKA-3298:
-----------------------------------

Weird things happen, but the join() should  work in this case.
https://github.com/apache/tika/blob/main/tika-parsers/tika-parsers-classic/tika-parsers-classic-modules/tika-parser-ocr-module/src/test/java/org/apache/tika/parser/ocr/TesseractOCRParserTest.java#L309

There are two options to get langs...just run this code:
{noformat}
        TesseractOCRParser p = new TesseractOCRParser();
        p.setPreloadLangs(true);
        p.initialize(Collections.EMPTY_MAP);
        return p.getLangs();
{noformat}

Or try to find the TesseractOCRParser within the 
AutoDetectParser/DefaultParser...this option is not as guaranteed...





> Add a "preloadLangs" parameter to TesseractOCRParser
> ----------------------------------------------------
>
>                 Key: TIKA-3298
>                 URL: https://issues.apache.org/jira/browse/TIKA-3298
>             Project: Tika
>          Issue Type: Task
>            Reporter: Tim Allison
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: image-2021-02-10-18-59-47-793.png, 
> image-2021-02-10-19-00-10-691.png, image-2021-02-11-08-56-38-712.png
>
>
> [~peterkronenberg] on the user/dev lists and on TIKA-3297 and TIKA-3296 has 
> observed that the tesseract error message for "lang data doesn't exist" is 
> not extremely clear.  We could add a "preloadLangs" option to 
> TesseractOCRParser (default would be {{false}}).  If set to true, the parser 
> (upon initialization) if it finds tesseract, will call {{tesseract 
> --list-langs}} and then store those langs.  At parse time, if the langs set 
> has anything in it, the TesseractOCRParser will check that set against the 
> user-requested language and throw a clearer exception to the user that the 
> language data doesn't exist for the requested language.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to