Skip to main content
This object represents a base recognition language. The TextLanguage object — a recognition language for a text — contains a collection of base languages. For example, English or French languages may be represented by base languages. This object provides access to a base language attributes and allows you to get/set its internal name, letter sets, dictionary type, etc. The BaseLanguage object is a persistent object. This means that the object’s current state can be written to persistent storage. Later, the object can be re-created by reading the object’s state from the persistent storage. The following methods provide persistence of the object: Linux: SaveToFile, and LoadFromFile Windows SaveToFile, LoadFromFile, SaveToMemory, and LoadFromMemory.

Properties

Name

Type

Description

Application

Engine, read-only

Returns the Engine object.

Main attributes

LanguageId

LanguageIdEnum

Defines the ID of the language. To convert it to Win32 LCID use the IEngine::ConvertLanguageIdToLCID method.

By default, this property is initialized with the system default language ID.

InternalName

BSTR

Specifies the internal name of the base language. This name appears as an attribute of a character in the recognized text, so it is recommended that it were unique.

The property is an empty string by default.

LetterSet

BSTR

Provides access to the specified letter set of the base language.

DictionaryDescriptions

DictionaryDescriptions, read-only

Returns a reference to the dictionary collection.

Additional attributes

IsNaturalLanguage

VARIANT_BOOL

Specifies if this base language is a natural language. Natural languages are designed for recognizing common texts. Formal languages are not natural ones.

If this property is TRUE, ABBYY FineReader Engine uses some additional information about the languages during recognition (for example, it can presume that the language can include not only alphabet characters but some other constructions like telephone numbers or URLs). If the property is FALSE, ABBYY FineReader Engine uses only the attributes specified in the language properties, no other information is used.

By default, the value of this property is FALSE.

AllowWordsFromDictionaryOnly

VARIANT_BOOL

Specifies if only the dictionary words are allowed during recognition in this base language. If this property is TRUE, a word that is not found in the dictionary of the base language can appear in the recognized text only if ABBYY FineReader Engine found no dictionary variants. If no dictionary is associated with the base language, the language will not be used for recognition.

By default, the value of this property is FALSE.

UserProperty

VARIANT

Allows you to associate some user-defined information of any type with the BaseLanguage object.

Methods

NameDescription
CopyFromInitializes properties of the current object with values of similar properties of another object.
LoadFromFileRestores the object contents from a file on disk.
LoadFromMemory <Note> : Windows only. </Note>Restores the object contents from the global memory.
SaveToFileSaves the object contents into a file on disk.
SaveToMemory <Note> : Windows only. </Note>Saves the object contents into the global memory.
BaseLanguage Object Diagram

Output parameter

This object is the output parameter of the Item, AddNew methods of the BaseLanguages object.

Samples

// We presume that a new TextLanguage object have been created
// and all its attributes have been copied from a predefined language
// Obtain the first BaseLanguage object within TextLanguage
BaseLanguage baseLanguage = textLanguage.BaseLanguages[0];
// Change internal language name to user-defined
baseLanguage.InternalName = "SampleBaseLanguage";
// Set a user dictionary for the base language
IDictionaryDescriptions dictionaryDescriptions = baseLanguage.DictionaryDescriptions;
dictionaryDescriptions.DeleteAll();
IDictionaryDescription dictionaryDescription = dictionaryDescriptions.AddNew( DictionaryTypeEnum.DT_UserDictionary );
IUserDictionaryDescription userDictionaryDescription = dictionaryDescription.GetAsUserDictionaryDescription();
userDictionaryDescription.FileName = "D:\\SampleDictionary.amd";
// Use the text language for recognition
...
The object is used in the following code samples for Linux and Windows: CustomLanguage.

See also

BaseLanguages Working with Languages Working with Dictionaries Working with Properties