RecognizedWordUnit 클래스

정의

인식된 음성을 원자 단위로 제공합니다.

public ref class RecognizedWordUnit
[System.Serializable]
public class RecognizedWordUnit
[<System.Serializable>]
type RecognizedWordUnit = class
Public Class RecognizedWordUnit
상속
RecognizedWordUnit
특성

예제

다음 예제에서는 유틸리티 루틴을 보여 줍니다 (stringFromWordArray) 문자열을 생성 하는 합니다. 어휘 출력을 포함 하는 문자열 (사용 하 여 LexicalForm), 텍스트 정규화 (사용 하 여 Text), 또는 음성 국제 윗주 알파벳 문자 (사용 하 여 Pronunciation). 문자열 서식을 사용 하 DisplayAttributes 에서 가져온 개체는 DisplayAttributes 속성을 ReadOnlyCollection<T>RecognizedWordUnit 개체입니다. RecognizedWordUnit 개체에서 가져온 합니다 Words 속성에는 RecognizedPhrase 개체.

internal enum WordType   
{  
  Text,  
  Normalized = Text,  
  Lexical,  
  Pronunciation  
}  
internal static string stringFromWordArray(ReadOnlyCollection<RecognizedWordUnit> words, WordType type)   
{  
  string text = "";  
  foreach (RecognizedWordUnit word in words)   
  {  
    string wordText = "";  
    if (type == WordType.Text || type == WordType.Normalized)   
    {  
      wordText = word.Text;  
    }   
    else if (type == WordType.Lexical)   
    {  
      wordText = word.LexicalForm;  
    }   
    else if (type == WordType.Pronunciation)   
    {  
      wordText = word.Pronunciation;  
    }   
    else   
    {  
      throw new InvalidEnumArgumentException(String.Format("[0}: is not a valid input", type));  
    }  
    // Use display attribute  

    if ((word.DisplayAttributes & DisplayAttributes.OneTrailingSpace) != 0)   
    {  
      wordText += " ";  
    }  
    if ((word.DisplayAttributes & DisplayAttributes.TwoTrailingSpaces) != 0)  
    {  
      wordText += "  ";  
    }  
    if ((word.DisplayAttributes & DisplayAttributes.ConsumeLeadingSpaces) != 0)   
    {  
      wordText = wordText.TrimStart();  
    }  
    if ((word.DisplayAttributes & DisplayAttributes.ZeroTrailingSpaces) != 0)  
    {  
      wordText = wordText.TrimEnd();  
    }  

    text += wordText;  

  }  
  return text;  
}  

설명

인식 엔진에 의해 반환 된 모든 결과의 생성 된 RecognizedWordUnit 개체입니다.

배열을 RecognizedWordUnit 개체를 통해 모든 인식 작업을 위해 액세스할 수 합니다 Words 속성에는 RecognizedPhrase 개체입니다.

인식의 확신도의 측정값을 제공 하는 것 외에도 (Confidence)는 RecognizedWordUnit 인스턴스를 제공 합니다.

  • 인식된 된 단어에 대 한 정규화 된 및 정확한 (또는 어휘) 텍스트 표현입니다. 자세한 내용은 ReplacementText, TextLexicalForm을 참조하십시오.

  • International Phonetic Alphabet (IPA) 또는 유니버설 전화 설정 (UPS)와 같은 지원 되는 음성 알파벳에서 문자를 사용 하 여 발음 정보입니다. 자세한 내용은 Pronunciation를 참조하세요.

  • 인쇄에 대 한 서식 지정 합니다. 자세한 내용은 참조는 DisplayAttributes 클래스 및 해당 DisplayAttributes 속성입니다.

생성자

RecognizedWordUnit(String, Single, String, String, DisplayAttributes, TimeSpan, TimeSpan)

RecognizedWordUnit 클래스의 새 인스턴스를 초기화합니다.

속성

Confidence

인식된 단어가 지정된 입력과 일치할 가능성을 나타내는 값(인식자가 할당)을 가져옵니다.

DisplayAttributes

현재 RecognizedWordUnit 인스턴스로부터 텍스트 출력을 만드는 데 사용된 서식 정보를 가져옵니다.

LexicalForm

인식된 단어의 정규화되지 않은 텍스트를 가져옵니다.

Pronunciation

인식된 단어의 발음 기호를 가져옵니다.

Text

인식된 단어의 정규화된 텍스트를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보