DictationGrammar 클래스

정의

자유 텍스트 받아쓰기를 위해 사용하는 스피치 인식 그래머를 표현한다

public ref class DictationGrammar : System::Speech::Recognition::Grammar
public class DictationGrammar : System.Speech.Recognition.Grammar
type DictationGrammar = class
    inherit Grammar
Public Class DictationGrammar
Inherits Grammar
상속
DictationGrammar

예제

다음 예제에서는 세 가지 받아쓰기 문법 만듭니다, 새 추가 SpeechRecognitionEngine 개체를 새 개체를 반환 합니다. 첫 번째 문법에는 기본 받아쓰기 문법이입니다. 두 번째 문법 맞춤법 받아쓰기 문법이입니다. 세 번째 문법에 컨텍스트 구를 포함 하는 기본 받아쓰기 문법이입니다. 합니다 SetDictationContext 메서드는 로드 된 후 상황에 맞는 구 받아쓰기 문법을 연결 데는 SpeechRecognitionEngine 개체입니다.

private SpeechRecognitionEngine LoadDictationGrammars()  
{  

  // Create a default dictation grammar.  
  DictationGrammar defaultDictationGrammar = new DictationGrammar();  
  defaultDictationGrammar.Name = "default dictation";  
  defaultDictationGrammar.Enabled = true;  

  // Create the spelling dictation grammar.  
  DictationGrammar spellingDictationGrammar =  
    new DictationGrammar("grammar:dictation#spelling");  
  spellingDictationGrammar.Name = "spelling dictation";  
  spellingDictationGrammar.Enabled = true;  

  // Create the question dictation grammar.  
  DictationGrammar customDictationGrammar =  
    new DictationGrammar("grammar:dictation");  
  customDictationGrammar.Name = "question dictation";  
  customDictationGrammar.Enabled = true;  

  // Create a SpeechRecognitionEngine object and add the grammars to it.  
  SpeechRecognitionEngine recoEngine = new SpeechRecognitionEngine();  
  recoEngine.LoadGrammar(defaultDictationGrammar);  
  recoEngine.LoadGrammar(spellingDictationGrammar);  
  recoEngine.LoadGrammar(customDictationGrammar);  

  // Add a context to customDictationGrammar.  
  customDictationGrammar.SetDictationContext("How do you", null);  

  return recoEngine;  
}  

설명

이 클래스는 텍스트를 음성된 사용자 입력을 처리할 수 있는 미리 정의 된 언어 모델을 사용 하 여 애플리케이션을 제공 합니다. 이 클래스는 기본 및 사용자 지정을 모두 지원 DictationGrammar 개체입니다. 받아쓰기 문법 선택에 대 한 자세한 내용은 참조는 DictationGrammar(String) 생성자입니다.

기본적으로 DictationGrammar 언어 모델은 무료 컨텍스트입니다. 특정 단어의 사용 또는 단어 순서를 식별 하 고 오디오 입력을 해석 하 게 만들지 않습니다. 받아쓰기 문법에 컨텍스트를 추가 하려면 사용 된 SetDictationContext 메서드.

참고

DictationGrammar 개체는 지원 하지는 Priority 속성입니다. DictationGrammar throw 된 NotSupportedException 경우 Priority 설정 됩니다.

생성자

DictationGrammar()

Windows 데스크톱 음성 기술을 통해 제공되는 기본 받아쓰기 문법에 대한 DictationGrammar 클래스의 새 인스턴스를 초기화합니다.

DictationGrammar(String)

지정된 받아쓰기 문법을 사용하여 DictationGrammar 클래스의 새 인스턴스를 초기화합니다.

속성

Enabled

음성 인식기가 Grammar를 사용하여 인식을 수행할 수 있는지 여부를 제어하는 값을 가져오거나 설정합니다.

(다음에서 상속됨 Grammar)
IsStg

문법이 강력한 형식으로 되어있는지 여부를 가져옵니다.

(다음에서 상속됨 Grammar)
Loaded

음성 인식기가 Grammar을 로드했는지 여부를 가져옵니다.

(다음에서 상속됨 Grammar)
Name

Grammar 개체의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 Grammar)
Priority

Grammar 개체의 우선 순위 값을 가져오거나 설정합니다.

(다음에서 상속됨 Grammar)
ResourceName

현재 Grammar를 로드하는 데 사용하는 이진 리소스의 이름을 사용하여 값을 가져오거나 설정합니다.

(다음에서 상속됨 Grammar)
RuleName

Grammar 개체의 루트 규칙 또는 입력 지점의 이름을 가져옵니다.

(다음에서 상속됨 Grammar)
Weight

Grammar 개체의 가중치 값을 가져오거나 설정합니다.

(다음에서 상속됨 Grammar)

메서드

Equals(Object)

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

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

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

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

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

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

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

(다음에서 상속됨 Object)
SetDictationContext(String, String)

SpeechRecognizer 또는 SpeechRecognitionEngine 개체에 의해 로드된 받아쓰기 문법에 컨텍스트를 추가합니다.

StgInit(Object[])

StgInit 메서드는 강력한 형식의 문법을 초기화합니다.

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

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

(다음에서 상속됨 Object)

이벤트

SpeechRecognized

음성 인식기가 Grammar 개체를 사용하여 인식을 수행할 때 발생했습니다.

(다음에서 상속됨 Grammar)

적용 대상

추가 정보