public final class LanguageContainer
extends java.lang.Object
This is container for recognition languages. It needs to set a set of recognition languages.
Recognition of multiple languages. The text is recognized by words. Each recognized word has a specific language. There is priority of 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.Languages.AddLanguage(Language.Load("english")); ocr.Languages.AddLanguage(Language.Load("spain")); ILanguage language = ocr.Languages.GetLanguage("spain");
Modifier and Type | Method and Description |
---|---|
void |
addLanguage(ILanguage language)
Adds to the collection recognition language.
|
ILanguage |
get_Item(int index)
Gets language by index.
|
int |
getCount()
Gets total count of languages in container.
|
ILanguage |
getLanguage(java.lang.String language)
Gets the language from the collection.
|
IEnumerator |
iterator()
Gets enumerator that can be used to loop through the collection.
|
void |
set_Item(int index,
ILanguage value)
Sets language by index.
|
public void addLanguage(ILanguage language)
Adds to the collection recognition language. If such language is already in the collection, it added again.
language
- The ILanguage
object to add.public ILanguage get_Item(int index)
Gets language by index.
index
- Index of language.ILanguage
instance.public int getCount()
Gets total count of languages in container.
public ILanguage getLanguage(java.lang.String language)
Gets the language from the collection.
language
- Name of language.ILanguage
object.OcrException
- The specified language does not exist.public IEnumerator iterator()
Gets enumerator that can be used to loop through the collection.
public void set_Item(int index, ILanguage value)
Sets language by index.
index
- Index of language.