Class Grammar
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.Grammar
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ClassLanguageModel,GrammarList,PhraseListGrammar
public class Grammar extends Object implements AutoCloseable
Represents a generic grammar used to assist in improving speech recogniton accuracy. Note: close() must be called in order to release underlying resources held by the object.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Dispose of associated resources.static GrammarfromStorageId(String id)Creates a Grammar from its storage Id.SafeHandlegetImpl()Returns the internal grammar instance
-
-
-
Method Detail
-
fromStorageId
public static Grammar fromStorageId(String id)
Creates a Grammar from its storage Id. Creating a grammar from a storage ID is only usable in specific scenarios and is not generally possible.- Parameters:
id- The Id of the grammar- Returns:
- Grammar associated with the given Id.
-
close
public void close()
Dispose of associated resources.- Specified by:
closein interfaceAutoCloseable
-
getImpl
public SafeHandle getImpl()
Returns the internal grammar instance- Returns:
- The internal grammar instance
-
-