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

# Text オブジェクトの GetRecognizedWord メソッド

このメソッドを使用すると、テキスト内の選択した単語について、指定した認識候補にアクセスできます。単語の主要な認識候補 (結果のテキストで使用されるもの) と、その他すべての候補を確認できます。

> [!WARNING]
>
> このメソッドは認識候補 API の一部です。認識の前に [**Engine**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine.md) オブジェクトの [**EnableRecognitionVariants**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine-enablerecognitionvariants.md) メソッドを呼び出して認識候補の保存を有効にした場合にのみ使用できます。

> [!NOTE]
>
> 認識候補を扱う API は、手書き風文字のテキストの認識には使用できません。

## 構文

```vb Visual Basic .NET theme={null}
Sub GetRecognizedWord( _
  wordIndex As Integer, _
  variantIndex As Integer, _
  result As RecognizedWordInfo _
)
```

```cpp C++ theme={null}
HRESULT GetRecognizedWord(
   int                  wordIndex,
   int                  variantIndex,
   IRecognizedWordInfo* result
);
```

## パラメーター

**wordIndex**

\[in] テキスト内の単語のインデックスを指定します。0 から [**IText::RecognizedWordsCount**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/text.md#recognizedwordscount) の値から 1 を引いた値までの範囲で指定する必要があります。

**variantIndex**

\[in] 単語の認識候補を格納する内部コレクション内での、認識候補のインデックスを指定します。コレクション内の要素数は、単語の任意の認識候補の [**IRecognizedWordInfo::RecognitionVariantsCount**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/recognizedwordinfo.md#recognitionvariantscount) プロパティで取得できます。認識候補は、精度の高いものから低いものの順に並んでいます。このパラメーターには -1 を指定することもでき、その場合は主要な認識候補が返されます。

**result**

\[in] [**RecognizedWordInfo**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/recognizedwordinfo.md) オブジェクトを参照します。このオブジェクト型のプロパティは、単語の候補のパラメーターに対応する値で初期化されます。このパラメーターには有効なオブジェクトを渡す必要があります。

## 戻り値

この関数には固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## 関連項目

[**Text**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/text.md)
