跳轉到主要內容
此物件代表一個基礎識別語言。TextLanguage 物件——用於文字的識別語言——包含一個基礎語言的集合。例如,英語或法語可由基礎語言來表示。此物件提供對基礎語言屬性的存取,並允許您取得或設定其內部名稱、字母集 (letter sets) 、dictionary 型別等。 BaseLanguage 物件是一個持久性物件,這表示該物件的當前狀態可以寫入持久性儲存空間,之後可透過從持久性儲存空間讀取物件狀態來重新建立該物件。以下方法可提供物件的持久性: Linux:SaveToFileLoadFromFile Windows:SaveToFileLoadFromFileSaveToMemoryLoadFromMemory

Properties

,read-only

Returns the Engine object.

Defines the ID of the language. To convert it to Win32 LCID use themethod.

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

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.

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

,read-only

Returns a reference to the dictionary collection.

指定此基礎語言是否為自然語言。自然語言專為識別一般文字而設計,形式語言則不屬於自然語言。

若此屬性為 TRUE,ABBYY FineReader Engine 在識別過程中會使用語言的額外資訊 (例如,可假設該語言不僅包含字母字元,還可能包含電話號碼或 URL 等其他結構) 。若此屬性為 FALSE,ABBYY FineReader Engine 僅使用語言屬性中指定的設定,不使用其他任何資訊。

此屬性的預設值為 FALSE。

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.

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

方法

名稱描述
CopyFrom使用另一個物件的類似屬性值初始化目前物件的屬性。
LoadFromFile從磁碟上的檔案還原物件內容。
LoadFromMemory <Note> : 僅限 Windows。 </Note>從全域記憶體還原物件內容。
SaveToFile將物件內容儲存至磁碟上的檔案。
SaveToMemory <Note> : 僅限 Windows。 </Note>將物件內容儲存至全域記憶體。
BaseLanguage 物件圖

輸出 Parameter

此物件是 BaseLanguages 物件的 ItemAddNew 方法的輸出 Parameter。

範例

// 我們假設已建立一個新的 TextLanguage 物件
// 並從預定義語言複製其所有屬性
// 從 TextLanguage 中取得第一個 BaseLanguage 物件
BaseLanguage baseLanguage = textLanguage.BaseLanguages[0];
// 將內部語言名稱設為使用者自訂名稱
baseLanguage.InternalName = "SampleBaseLanguage";
// 為基礎語言設定使用者字典
IDictionaryDescriptions dictionaryDescriptions = baseLanguage.DictionaryDescriptions;
dictionaryDescriptions.DeleteAll();
IDictionaryDescription dictionaryDescription = dictionaryDescriptions.AddNew( DictionaryTypeEnum.DT_UserDictionary );
IUserDictionaryDescription userDictionaryDescription = dictionaryDescription.GetAsUserDictionaryDescription();
userDictionaryDescription.FileName = "D:\\SampleDictionary.amd";
// 使用此文字語言進行識別
...
此物件用於 Linux 和 Windows 的下列程式碼範例:CustomLanguage

另請參閱

BaseLanguages 使用語言 使用字典 使用 Properties