> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dictionary オブジェクト（IDictionary インターフェイス）

> ABBYY FineReader Engine API の Dictionary オブジェクト（IDictionary インターフェイス）— ユーザー辞書および辞書拡張を扱うためのオブジェクト。単語の追加/削除、単語の反復処理、（Windows では）ダイアログを使用した辞書の編集に対応します。

このオブジェクトは、ユーザー辞書および辞書拡張を操作するためのものです。ユーザー辞書とは、特定の言語の単語の語形を収録した辞書です。辞書内の各語形にはそれぞれ重みが設定されており、認識時にある単語に対して複数の候補がある場合、その優先順位を決定します。重みには、離散的な値のセットを指定できます。値の範囲は 0 から 100 です。ユーザー辞書は、1 つの基本認識言語を表す [BaseLanguage](/ja/fine-reader/engine/api-reference/language-related-objects/baselanguage) オブジェクトに関連付けることができます。辞書拡張は、標準辞書がサポートされている言語に対してのみ使用できます。

Dictionary オブジェクトのインターフェイスへのポインターは、[LanguageDatabase](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase) オブジェクトの [CreateNewDictionary](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase/createnewdictionary-method)、[OpenExistingDictionary](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase/openexistingdictionary-method)、または [OpenDictionaryExtension](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase/opendictionaryextension-method) メソッドから取得できます。OpenExistingDictionary メソッドでは、CreateNewDictionary メソッドを使用して作成した辞書を開くことができます。OpenDictionaryExtension では、辞書拡張のインターフェイスにアクセスできます。

<Note>
  Windows では、[Edit](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/edit-method) メソッドにより、ユーザーが辞書を編集し、Windows ANSI および Unicode エンコードの任意のテキストファイルをインポートできる [Dictionary ダイアログ](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/edit-method/dictionary-dialog-box) が表示されます (唯一の要件は、単語がスペースまたはその他のアルファベット以外の文字で区切られていることです) 。
</Note>

<div id="properties">
  ## プロパティ
</div>

| 名前          | 型                                                                                                                                                                                                                | 説明                                                                                                                                                                                                                                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Application | [Engine](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface), [読み取り専用](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties#readonly_properties) | Engine オブジェクトを返します。                                                                                                                                                                                                                                                                                               |
| Name        | [BSTR](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties)                                                                                                       | 辞書の名前を格納します。Windows では、この名前が [Dictionary ダイアログ](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/edit-method/dictionary-dialog-box) のキャプションに表示されます。Dictionary オブジェクトの作成後、このプロパティには辞書ファイル名 (パスと拡張子を除く) が格納されます。任意の別の値を設定することもできます。このプロパティは辞書に関連付けられたファイルには保存されないため、辞書を編集するたびに初期化する必要があります。 |
| WordsCount  | [int](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties), 読み取り専用                                                                                                | 辞書内の単語数を返します。                                                                                                                                                                                                                                                                                                     |

<div id="methods">
  ## メソッド
</div>

| 名前                                                                                                                                    | 説明                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddWord](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/addword-method)                                    | 辞書に単語を追加します。                                                                                                                                       |
| [AddWords](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/addwords-method)                                  | 辞書に複数の単語を追加します。                                                                                                                                    |
| [DeleteAllWords](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/deleteallwords-method)                      | 辞書からすべての単語を削除します。                                                                                                                                  |
| [DeleteWord](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/deleteword-method)                              | 辞書から単語を削除します。                                                                                                                                      |
| [DeleteWords](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/deletewords-method)                            | 辞書から複数の単語を削除します。                                                                                                                                   |
| [Edit](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/edit-method) <br /><br /> **注:** *Windows で実装されています。* | ユーザーが辞書を編集できる[Dictionary ダイアログ](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/edit-method/dictionary-dialog-box)を表示します。 |
| [EnumWords](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/enumwords-method)                                | 辞書内の単語を順に処理できる [EnumDictionaryWords](/ja/fine-reader/engine/api-reference/language-related-objects/enumdictionarywords) 型のオブジェクトを返します。             |

<div id="output-parameter">
  ## 出力パラメーター
</div>

このオブジェクトは、[LanguageDatabase](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase)オブジェクトの[CreateNewDictionary](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase/createnewdictionary-method)、[OpenExistingDictionary](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase/openexistingdictionary-method)、[OpenDictionaryExtension](/ja/fine-reader/engine/api-reference/language-related-objects/languagedatabase/opendictionaryextension-method)メソッドの出力パラメーターとなるオブジェクトです。

<div id="samples">
  ## サンプル
</div>

<Accordion title="C# code">
  ```csharp theme={null}
  // このコード例では、ユーザー辞書を作成して基本言語に割り当てます
  FREngine.IEngine engine;
  string dictionaryFileName = "D:\\Sample.amd";
  FREngine.IBaseLanguage baseLanguage;
  // 新しい辞書を作成
  ILanguageDatabase languageDatabase = Engine.CreateLanguageDatabase();
  IDictionary dictionary = languageDatabase.CreateNewDictionary( dictionaryFileName,
   LanguageIdEnum.LI_EnglishUnitedStates );
  dictionary.Name = "SampleUserDictionary";
  // 辞書に単語を追加
  dictionary.AddWord( "the", 100 );
  dictionary.AddWord( "a", 100 );
  dictionary.AddWord( "an", 100 );
  // 基本言語の辞書記述のコレクションを取得し、すべての項目を削除
  IDictionaryDescriptions dictionaryDescriptions = baseLanguage.DictionaryDescriptions;
  dictionaryDescriptions.DeleteAll();
  // ユーザー辞書記述を作成し、コレクションに追加
  IDictionaryDescription dictionaryDescription = dictionaryDescriptions.AddNew( DictionaryTypeEnum.DT_UserDictionary );
  IUserDictionaryDescription userDictionaryDescription = dictionaryDescription.GetAsUserDictionaryDescription();
  userDictionaryDescription.FileName = dictionaryFileName;
  ```
</Accordion>

このオブジェクトは、Linux および Windows の次のコード サンプルで使用されています: [CustomLanguage](/ja/fine-reader/engine/guided-tour/samples#customlanguage).

<div id="see-also">
  ## 関連項目
</div>

[UserDictionaryDescription](/ja/fine-reader/engine/api-reference/language-related-objects/userdictionarydescription)

[辞書の使用方法](/ja/fine-reader/engine/guided-tour/advanced-techniques/working-with-dictionaries)

[プロパティの使用方法](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties)
