java.lang.Object
com.ibm.cloud.sdk.core.service.model.GenericModel
com.ibm.watson.speech_to_text.v1.model.Grammar
All Implemented Interfaces:
com.ibm.cloud.sdk.core.service.model.ObjectModel

public class Grammar
extends com.ibm.cloud.sdk.core.service.model.GenericModel
Information about a grammar from a custom language model.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static interface  Grammar.Status
    The status of the grammar: * `analyzed`: The service successfully analyzed the grammar.
  • Constructor Summary

    Constructors
    Constructor Description
    Grammar()  
  • Method Summary

    Modifier and Type Method Description
    String getError()
    Gets the error.
    String getName()
    Gets the name.
    Long getOutOfVocabularyWords()
    Gets the outOfVocabularyWords.
    String getStatus()
    Gets the status.

    Methods inherited from class com.ibm.cloud.sdk.core.service.model.GenericModel

    equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Grammar

      public Grammar()
  • Method Details

    • getName

      public String getName()
      Gets the name.

      The name of the grammar.

      Returns:
      the name
    • getOutOfVocabularyWords

      public Long getOutOfVocabularyWords()
      Gets the outOfVocabularyWords.

      The number of OOV words in the grammar. The value is `0` while the grammar is being processed.

      Returns:
      the outOfVocabularyWords
    • getStatus

      public String getStatus()
      Gets the status.

      The status of the grammar: * `analyzed`: The service successfully analyzed the grammar. The custom model can be trained with data from the grammar. * `being_processed`: The service is still analyzing the grammar. The service cannot accept requests to add new resources or to train the custom model. * `undetermined`: The service encountered an error while processing the grammar. The `error` field describes the failure.

      Returns:
      the status
    • getError

      public String getError()
      Gets the error.

      If the status of the grammar is `undetermined`, the following message: `Analysis of grammar '{grammar_name}' failed. Please try fixing the error or adding the grammar again by setting the 'allow_overwrite' flag to 'true'.`.

      Returns:
      the error