Class LanguageContainer

  • 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();
     ILanguage language = ocr.getLanguageContainer().getLanguages().get(0);

    • Method Detail

      • addLanguage

        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.
      • addLanguages

        public void addLanguages(ILanguage[] languages)

        Adds a range of languages to the language container

        languages - The ILanguage array to add.
      • clear

        public void clear()

        Removes all languages from language container

      • dispose

        public void dispose()

        Disposes the container

      • getLanguages

        public ILanguage[] getLanguages()

        Array of all the languages loaded into the language container

      • removeLanguage

        public void removeLanguage(ILanguage language)

        Removes specified language from the container

        language - The ILanguage object to be removed
      • removeLanguages

        public void removeLanguages(ILanguage[] languages)

        Removes a range of languages from the container

        languages - Array of ILanguage to be removed
      • resetToDefaults

        public void resetToDefaults()

        Clears all loaded languages and loads the default one