public final class LanguageContainer extends Object
A container for recognition languages.
Recognition of multiple languages. The text is recognized by words. Each recognized word has a specific language. There is a priority in recognition languages. Language that was added earlier to the collection has a higher priority. If the word is identical in several languages, a language that was earlier added to the collection will be selected.
OcrEngine ocr = new OcrEngine(); ocr.getLanguageContainer().addLanguage(LanguageFactory.load("engresources.zip")); ILanguage language = ocr.getLanguageContainer().getLanguages().get(0);
Modifier and Type | Method and Description |
---|---|
void |
addLanguage(ILanguage language)
Adds a language to language container.
|
void |
addLanguages(ILanguage[] languages)
Adds a range of languages to the language container
|
void |
clear()
Removes all languages from language container
|
void |
dispose()
Disposes the container
|
ILanguage[] |
getLanguages()
Array of all the languages loaded into the language container
|
void |
removeLanguage(ILanguage language)
Removes specified language from the container
|
void |
removeLanguages(ILanguage[] languages)
Removes a range of languages from the container
|
void |
resetToDefaults()
Clears all loaded languages and loads the default one
|
public void addLanguage(ILanguage language)
Adds a language to language container. If such language is already in the collection, it is added again.
language
- The ILanguage
object to add.public void addLanguages(ILanguage[] languages)
Adds a range of languages to the language container
languages
- The ILanguage
array to add.public void clear()
Removes all languages from language container
public void dispose()
Disposes the container
public ILanguage[] getLanguages()
Array of all the languages loaded into the language container
public void removeLanguage(ILanguage language)
Removes specified language from the container
language
- The ILanguage
object to be removedpublic void removeLanguages(ILanguage[] languages)
Removes a range of languages from the container
languages
- Array of ILanguage
to be removedpublic void resetToDefaults()
Clears all loaded languages and loads the default one
Copyright © 2017. All Rights Reserved.