|
KeenASR Framework v2.1 (8b72cc4)
Keen Research
|
#include <KIOSWordPronunciation.h>
Instance Methods | |
| (instancetype) | - initWithWord:pronunciation:tag: |
| (nonnull NSString *) | - getWord |
| (nonnull NSString *) | - getTag |
| (nonnull NSString *) | - getPronunciation |
| (BOOL) | - isValid: |
WordPronunciation is a class that defines mapping beween a word and its phonetic pronunciation. Phonetic pronunciation is a space separated string of phonemes that define how the word is pronounced. The names of the phonemes are defined in ASR Bundle lang/phones.txt file. For some languages for which this mapping is not deterministic, ASR Bundle will contain a large lookup table in lang/lexicon.txt file.
You can use WordPronunciations to provide alternatives to existing pronunciations, to define pronunciations for the words that are not in the lexicon.txt file (including made-up words), or to provide common mispronunciations (which can be useful in some scenarios such as language learning and reading instruction); For the latter, you can also provide a tag when defining WordPronunciation; if such alternative pronunciation is recognized by the recognizer, the # symbol and the provided tag will be appended to the word in the result (e.g. "PEAK#WRONG", if the tag was set to "WRONG").
Example:
| - (nonnull NSString *) getPronunciation |
Get the phonetic transcription of a word, provided as a space-separated sequence of phones.
| - (nonnull NSString *) getTag |
Get the optional tag value, which, if provided, will be appended together with the # symbol to the word if the variation of the word with the provided pronunciation is recognized. For example, PEAK#WRONG.
| - (nonnull NSString *) getWord |
Get the string specifying the word. For example "CAT".
| - (instancetype) initWithWord: | (nonnull NSString *) | word | |
| pronunciation: | (nonnull NSString *) | pronunciation | |
| tag: | (nullable NSString *) | tag |
Parameterized constructor
NOTE: both word and phones will internally be stored in uppercase.
| word | string specifying the word. For example "CAT". |
| pronunciation | a space separated phone string. |
| tag | a tag suffix for the word. |
| - (BOOL) isValid: | (nonnull KIOSRecognizer *) | recognizer |
Verify if this object is valid, for a given KIOSRecognizer.
A word pronunciation is valid if:
| recognizer | an instance of KIOSRecognizer object against which the validation should be performed. |