> ## 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.

# AddWords メソッド

> ABBYY FineReader Engine API の Dictionary Object の AddWords メソッド — 対応する重みを持つ単語のコレクションを 1 回の呼び出しで辞書に追加します。

このメソッドは、単語のグループを辞書に追加します。追加する単語のいずれかがすでに辞書に存在する場合、重複エントリは作成されませんが、その単語の重みには、辞書内で指定されている重みと、このメソッドの呼び出し時に渡した重みのうち大きい方が使用されます。

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

```cpp theme={null}
HRESULT AddWords(
  IStringsCollection* Words,
  IIntsCollection*    Weights
);
```

### C\#

```csharp theme={null}
void AddWords(
  IStringsCollection Words,
  IIntsCollection    Weights
);
```

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

```vb theme={null}
Sub AddWords( _
  Words As IStringsCollection, _
  [Weights As IIntsCollection = Nothing] _
)
```

<div id="parameters">
  ## パラメーター
</div>

Words

\[in] [StringsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/stringscollection) 型のこの Parameter には、新たに追加された単語のコレクションが含まれます。

Weights

\[in] [IntsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) 型のこの Parameter は、単語のコレクションと同じサイズである必要があり、新たに追加された単語の重み情報を渡すために使用されます。単語の重みは 1 ～ 100 の範囲でなければなりません。この Parameter は省略可能で、0 を指定することもできます。その場合、すべての単語は既定の重み 100 で辞書に登録されます。辞書内で単語に割り当てられる重みは、離散的な値のセットのいずれかに限られます。この Parameter に渡された値は、その離散的な値のセットのうち最も近い値に丸められます。

<div id="return-values">
  ## 戻り値
</div>

このメソッドに固有の戻り値はありません。戻り値として、[ABBYY FineReader Engine 関数の標準戻り値](/ja/fine-reader/engine/api-reference/return-codes)が返されます。

<div id="remarks">
  ## 備考
</div>

* より効率よく処理するには、追加する単語をあらかじめアルファベット順に並べ替えておくことをお勧めします。
* 辞書に単語を 1 つ追加するには、[IDictionary::AddWord](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/addword-method) メソッドを使用できます。

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

[Dictionary](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary)

[AddWord](/ja/fine-reader/engine/api-reference/language-related-objects/dictionary/addword-method)
