unpackLanguageFile Function
@JvmStatic fun unpackLanguageFile(languageFile: File, languagesDir: File): String
Installs a packed OCR language file into a directory ScanReader can read from.
Unpacks languageFile into languagesDir as <name>.traineddata, replacing any previous copy, and returns the name to pass to ScanReader.
Return
the language name to hand to ScanReader
Parameters
- languageFile — a packed language file, normally with a
.pxlextension - languagesDir — an existing directory to unpack into
Throws
- IllegalStateException — if
languagesDiris not an existing directory, or iflanguageFilehas no name before its extension