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 .pxl extension
  • languagesDir — an existing directory to unpack into

Throws

  • IllegalStateException — if languagesDir is not an existing directory, or if languageFile has no name before its extension
Top