Class KASRAlternativePronunciation

java.lang.Object
com.keenresearch.keenasr.KASRAlternativePronunciation

public class KASRAlternativePronunciation extends Object
KASRAlternativePronunciation provides way to specify alternative pronunciations for words that may not be in the lexicon from the ASR Bundle. You will typically use this class to define pronunciations in following scenarios: 1) word is not in the lexicon and you want to provide predefined pronunciation and not rely on automatic grapheme-to-phoneme module to define one; 2) word might be in lexicon but you would like to provide additional pronunciations (e.g. in some command and control scenarios you could define common mispronunciations of the word; 3) similar to 1) you could also use it to define pronunciation for made-up-words (for example in educational applications focused on reading).
  • Constructor Details

    • KASRAlternativePronunciation

      public KASRAlternativePronunciation(String word, String pronunciation, String tag)
      Creates an instance of KASRAltenativePronuncation object for a given word.
      Parameters:
      word - text of the word
      pronunciation - a string with space separated sequence of phonemes that represent pronunciation for this word
      tag - optional tag; if specified it will be appended to the word with a # symbol. For example, if the word is "APPLE" and the tag is "WRONG", then if variation with specified pronunciation is recognized, word will be APPLE#WRONG.
    • KASRAlternativePronunciation

      public KASRAlternativePronunciation(String word, String pronunciation)
      Creates an instance of KASRAltenativePronuncation object for a given word.
      Parameters:
      word - text of the word
      pronunciation - a string with space separated sequence of phonemes that represent pronunciation for this word
  • Method Details

    • getWord

      public final String getWord()
      Returns:
      String instance that contains word name for this alternative pronunciation.
    • getPronunciation

      public final String getPronunciation()
      Returns:
      String instance that contains space separated sequence of phonemes that define pronunciation of this word.
    • getTag

      public final String getTag()
      Returns:
      Tag that was associated with this alternative pronunciation;