跳轉到主要內容
此物件為字典描述物件,可轉型為下列其中一個子物件:StandardDictionaryDescriptionUserDictionaryDescriptionRegExpDictionaryDescriptionExternalDictionaryDescription。這些物件可用於存取四種不同字典類型的描述,並繼承 DictionaryDescription 物件的所有屬性。它們也都是 DictionaryDescriptions 集合中的元素。

Properties

NameTypeDescription
ApplicationEngine, 唯讀的回傳 Engine 物件。
TypeDictionaryTypeEnum, 唯讀的回傳字典的型別。
Weightint以百分比點數儲存字典的權重。此值必須為非負數。此屬性的預設值為 100%。

方法

名稱說明
GetAsExternalDictionaryDescriptionExternalDictionaryDescription 物件形式回傳字典描述。如果字典描述不是外部字典描述,則回傳 NULL。
GetAsRegExpDictionaryDescriptionRegExpDictionaryDescription 物件形式回傳字典描述。如果字典描述不是正規表示式字典描述,則回傳 NULL。
GetAsStandardDictionaryDescriptionStandardDictionaryDescription 物件形式回傳字典描述。如果字典描述不是標準字典描述,則回傳 NULL。
GetAsUserDictionaryDescriptionUserDictionaryDescription 物件形式回傳字典描述。如果字典描述不是使用者字典描述,則回傳 NULL。
DictionaryDescription 物件圖

輸出參數

此物件為 DictionaryDescriptions 物件之 Item 方法的輸出參數。

範例

// 此範例程式碼會將使用者字典指定給基礎語言
FREngine.IEngine engine;
string dictionaryFileName = "D:\\Sample.amd";
FREngine.IBaseLanguage baseLanguage;
// 取得基礎語言的字典描述集合,並刪除所有項目
IDictionaryDescriptions dictionaryDescriptions = baseLanguage.DictionaryDescriptions;
dictionaryDescriptions.DeleteAll();
// 建立使用者字典描述,並將其新增至集合
IDictionaryDescription dictionaryDescription = dictionaryDescriptions.AddNew( DictionaryTypeEnum.DT_UserDictionary );
IUserDictionaryDescription userDictionaryDescription = dictionaryDescription.GetAsUserDictionaryDescription();
userDictionaryDescription.FileName = dictionaryFileName;
此物件也用於下列 Linux 和 Windows 程式碼範例中:CustomLanguage

另請參閱

使用字典 DictionaryDescriptions StandardDictionaryDescription UserDictionaryDescription RegExpDictionaryDescription ExternalDictionaryDescription 使用屬性