KeenASR Unity Plugin 2.1.3
Unity plugin for KeenASR offline speech recognition SDK (iOS & Android)
Loading...
Searching...
No Matches
KeenResearch.WordPronunciation Class Reference

Specifies an alternative pronunciation for a word in a decoding graph. More...

Public Member Functions

 WordPronunciation (string word, string pronunciation, string tag=null)
 Creates an alternative pronunciation for a word.
 
bool IsValid ()
 Checks whether this pronunciation uses valid phones for the currently loaded ASR bundle. Requires the SDK to be initialized.
 

Properties

string word [get]
 The word this pronunciation applies to.
 
string pronunciation [get]
 Phonetic transcription as a space-separated sequence of phones (e.g. "P IH0 K").
 
string tag [get]
 Optional tag appended to the word with '#' when this pronunciation is recognized (e.g. tag "WRONG" produces "PEAK#WRONG" in the result). Null if not set.
 

Detailed Description

Specifies an alternative pronunciation for a word in a decoding graph.

Use this to define custom phonetic transcriptions for words, such as common mispronunciations for language learning or reading instruction. If a tag is provided and the alternative pronunciation is recognized, the tag is appended to the word in the result (e.g. "PEAK#WRONG").

var ap = new WordPronunciation("PEAK", "P IH0 K", "WRONG");
// If recognized with this pronunciation, result will show "PEAK#WRONG"
Specifies an alternative pronunciation for a word in a decoding graph.
Definition KeenASR.cs:81

Constructor & Destructor Documentation

◆ WordPronunciation()

KeenResearch.WordPronunciation.WordPronunciation ( string  word,
string  pronunciation,
string  tag = null 
)
inline

Creates an alternative pronunciation for a word.

Parameters
wordThe word this pronunciation applies to.
pronunciationPhonetic transcription as a space-separated sequence of phones.
tagOptional tag appended to the word when this pronunciation is recognized.

Member Function Documentation

◆ IsValid()

bool KeenResearch.WordPronunciation.IsValid ( )
inline

Checks whether this pronunciation uses valid phones for the currently loaded ASR bundle. Requires the SDK to be initialized.

Returns
true if all phones in the pronunciation are valid, false otherwise (including when the SDK is not initialized).

Property Documentation

◆ pronunciation

string KeenResearch.WordPronunciation.pronunciation
get

Phonetic transcription as a space-separated sequence of phones (e.g. "P IH0 K").

◆ tag

string KeenResearch.WordPronunciation.tag
get

Optional tag appended to the word with '#' when this pronunciation is recognized (e.g. tag "WRONG" produces "PEAK#WRONG" in the result). Null if not set.

◆ word

string KeenResearch.WordPronunciation.word
get

The word this pronunciation applies to.