ImageEn, unit ievision

LanguageExistsInFolder


Declaration

function LanguageExistsInFolder(aLanguage : TIEOCRLanguages; const sFolder : string) : Boolean; overload;
function LanguageExistsInFolder(const sLangCode : string; const sFolder : string) : Boolean; overload;


Description

Returns true if the language file for the specified language is found in a folder.

Language files of IEVision will be named with a language code followed by extensions such as traineddata (IEV_OCR_Language_Data_Ext), word-freq, params, size, etc.


Examples

if LanguageExistsInFolder(IEVisionLanguageNameToCode('English'), ExtractFilePath(Application.ExeName)) = False then
  MessageDlg('The English language OCR files could not be found. Please reinstall.', mtError, [mbOK], 0);

if LanguageExistsInFolder(OCR_English_language, ExtractFilePath(Application.ExeName)) = False then
  MessageDlg('The English language OCR files could not be found. Please reinstall.', mtError, [mbOK], 0);


See Also

- TIEOCRLanguages
- IEVisionGetLanguagesInFolder
- IEVisionLanguageCodeToName
- IEVisionLanguageNameToCode