This structure identifies a unique word for a grammar’s vocabulary.
typedef struct { // srw
DWORD dwSize;
DWORD dwWordNum;
TCHAR szWord[ ];
} SRWORD, *PSRWORD;
The application always specifies the word identifier when it loads a grammar. The application cannot specify a word identifier of zero because the grammar also uses a word identifier to notify the application when the corresponding word is spoken, and zero is reserved for situations when the word identifier is unknown.
In most European languages, szWord is a string such as “hello” or “car.” The text should not contain pronounced symbols. For example “345” is not a valid word string. The text also should not have ambiguous pronunciation. For example, instead of the string “IEEE,” use three words: “I” “triple” and “E.”
Certain languages, such as Japanese, use two characters: a phonemic set and a symbolic set. The phonemic character set should be passed in szWord. If an application is trying to associate the symbolic representation of the word, it should use dwWordNum to point to the symbolic word.
In some languages, the pronunciation cannot be easily deduced from the symbols that represent the word. For example, the same sequence of Kanji characters can be pronounced differently. In these languages, the phonetic character set appears first, followed by a backslash, followed by the commonly displayed character set. The engine should use the text before the backslash to determine the pronunciation of the word.