RecognitionResult クラス

定義

SpeechRecognitionEngine または SpeechRecognizer のインスタンスによって認識された入力に関する詳細な情報が含まれます。

public ref class RecognitionResult sealed : System::Speech::Recognition::RecognizedPhrase, System::Runtime::Serialization::ISerializable
[System.Serializable]
public sealed class RecognitionResult : System.Speech.Recognition.RecognizedPhrase, System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type RecognitionResult = class
    inherit RecognizedPhrase
    interface ISerializable
Public NotInheritable Class RecognitionResult
Inherits RecognizedPhrase
Implements ISerializable
継承
RecognitionResult
属性
実装

次の例は、 または SpeechRecognizer オブジェクトのイベントのSpeechRecognitionEngineハンドラーSpeechRecognizedと、関連付けられている RecognitionResultに関する情報の一部を示しています。

// Handle the SpeechRecognized event.   
void SpeechRecognizedHandler(object sender, SpeechRecognizedEventArgs e)  
{  
  if (e.Result == null) return;  

  // Add event handler code here.  

  // The following code illustrates some of the information available  
  // in the recognition result.  
  Console.WriteLine("Grammar({0}), {1}: {2}",  
    e.Result.Grammar.Name, e.Result.Audio.Duration, e.Result.Text);  

  // Display the semantic values in the recognition result.  
  foreach (KeyValuePair<String, SemanticValue> child in e.Result.Semantics)  
  {  
    Console.WriteLine(" {0} key: {1}",  
      child.Key, child.Value.Value ?? "null");  
  }  
  Console.WriteLine();  

  // Display information about the words in the recognition result.  
  foreach (RecognizedWordUnit word in e.Result.Words)  
  {  
    RecognizedAudio audio = e.Result.GetAudioForWordRange(word, word);  
    Console.WriteLine(" {0,-10} {1,-10} {2,-10} {3} ({4})",  
      word.Text, word.LexicalForm, word.Pronunciation,  
      audio.Duration, word.DisplayAttributes);  
  }  

  // Display the recognition alternates for the result.  
  foreach (RecognizedPhrase phrase in e.Result.Alternates)  
  {  
    Console.WriteLine(" alt({0}) {1}", phrase.Confidence, phrase.Text);  
  }  
}  

注釈

このクラスは から RecognizedPhrase 派生し、次のような音声認識に関する詳細情報を提供します。

  • プロパティは GrammarGrammar 認識エンジンが音声の識別に使用した を参照します。

  • プロパティには Text 、フレーズの正規化されたテキストが含まれます。 テキストの正規化の詳細については、「」を参照してください ReplacementText

  • プロパティは Semantics 、結果に含まれるセマンティック情報を参照します。 セマンティック情報は、キー名と関連するセマンティック データのディクショナリです。

  • プロパティには Alternates 、オーディオ入力の他の RecognizedPhrase 候補解釈を表す オブジェクトのコレクションが含まれています。 詳細については、「Alternates」を参照してください。

  • プロパティには Words 、入力で認識される各単語を表すオブジェクトの RecognizedWordUnit 順序付きコレクションが含まれています。 それぞれに RecognizedWordUnit 、対応する単語の表示形式、字句形式、発音情報が含まれます。

、、および Grammar クラスの特定のSpeechRecognitionEngineメンバーは、 をRecognitionResult生成SpeechRecognizerできます。 詳細については、次のメソッドとイベントを参照してください。

認識イベントの詳細については、「音声認識イベント の使用」を参照してください。

プロパティ

Alternates

音声レコグナイザーへの入力に対する一致候補のコレクションを取得します。

Audio

認識結果に関連付けられているオーディオを取得します。

Confidence

RecognizedPhrase が特定の入力と一致する確率を表す値 (認識エンジンによって割り当てられます) を取得します。

(継承元 RecognizedPhrase)
Grammar

音声認識エンジンが Grammar を返すために使用した RecognizedPhrase を取得します。

(継承元 RecognizedPhrase)
HomophoneGroupId

語句の同音異義語グループの識別子を取得します。

(継承元 RecognizedPhrase)
Homophones

この認識された語句と同じ発音の代替認識のコレクションを取得します。

(継承元 RecognizedPhrase)
ReplacementWordUnits

音声認識エンジンが音声からテキストへの正規化の一部として変更したテキストに関する情報を取得します。

(継承元 RecognizedPhrase)
Semantics

認識された語句に関連付けられているセマンティクス情報を取得します。

(継承元 RecognizedPhrase)
Text

認識された入力から音声認識エンジンによって生成された正規化テキストを取得します。

(継承元 RecognizedPhrase)
Words

認識された入力から音声認識エンジンによって生成される単語を取得します。

(継承元 RecognizedPhrase)

メソッド

ConstructSmlFromSemantics()

RecognizedPhrase オブジェクトのセマンティクス情報のセマンティクス マークアップ言語 (SML) ドキュメントを返します。

(継承元 RecognizedPhrase)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetAudioForWordRange(RecognizedWordUnit, RecognizedWordUnit)

認識結果の単語の特定の範囲に関連付けられたオーディオのセクションを取得します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

SerializationInfo インスタンスに、ターゲット オブジェクトをシリアル化するために必要なデータを設定します。

適用対象

こちらもご覧ください