Creates a new WordPronunciation.
Note: Both word and pronunciation are stored in uppercase internally.
The word string (e.g., "CAT")
Space-separated phone string (e.g., "K AE1 T")
Optional tag suffix for identifying this pronunciation variant
ReadonlywordThe word string (e.g., "CAT").
ReadonlypronunciationThe phonetic transcription as a space-separated sequence of phones (e.g., "K AE1 T").
ReadonlytagThe optional tag value.
When provided, this tag is appended with a # separator to the word if this
pronunciation variant is recognized (e.g., "PEAK#WRONG").
ReadonlyisWhether this WordPronunciation is valid for the current recognizer.
A WordPronunciation is valid if:
word does not contain < or > characterstag is not "INC" (reserved) and does not contain #pronunciation contains only valid phones defined in the ASR Bundle
Defines a mapping between a word and its phonetic pronunciation.
A phonetic pronunciation is a space-separated string of phonemes that define how the word is pronounced. Phoneme names are language-specific and defined in the ASR Bundle. For languages where spelling-to-pronunciation mapping is not deterministic, the ASR Bundle contains a lookup table in
lang/lexicon.txt.Use cases:
Tagging mispronunciations:
You can provide an optional
tagwhen constructing a WordPronunciation. If that pronunciation is recognized, the tag is appended to the word with a#separator. For example, with word"PEAK"and tag"WRONG", the result will contain"PEAK#WRONG".Example