-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,10 @@ | |
import org.audiveris.omr.text.TextLine; | ||
import org.audiveris.omr.text.TextWord; | ||
|
||
import org.bytedeco.javacpp.tesseract; | ||
import org.bytedeco.javacpp.tesseract.StringGenericVector; | ||
import org.bytedeco.javacpp.tesseract.TessBaseAPI; | ||
import org.bytedeco.tesseract.global.tesseract; | ||
import org.bytedeco.tesseract.StringGenericVector; | ||
import org.bytedeco.tesseract.TessBaseAPI; | ||
import static org.bytedeco.tesseract.global.tesseract.*; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
@@ -102,6 +103,11 @@ public Set<String> getLanguages () | |
final Path ocrFolder = getOcrFolder(); | ||
final TreeSet<String> set = new TreeSet<>(); | ||
|
||
// we need to call this to avoid crash | ||
// in native code on non-english systems | ||
// https://github.com/bytedeco/javacpp-presets/issues/694 | ||
setlocale(LC_ALL(), "C"); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
maximumspatium
Author
Contributor
|
||
|
||
try { | ||
final TessBaseAPI api = new TessBaseAPI(); | ||
|
||
|
@@ -305,9 +311,9 @@ private int getMode (LayoutMode layoutMode) | |
private Path scanOcrLocations (String[] locations) | ||
{ | ||
for (String loc : locations) { | ||
final Path path = Paths.get(loc); | ||
final Path path = Paths.get(loc).resolve("tessdata"); | ||
|
||
if (Files.exists(path.resolve("tessdata"))) { | ||
if (Files.exists(path)) { | ||
return path; | ||
} | ||
} | ||
|
Is this line really still needed? The Tesseract code should run with any locale settings (if it does not, that would be a bug).