SRWORD

typedef struct { // srw
DWORD dwSize;
DWORD dwWordNum;
TCHAR szWord[ ];
} SRWORD, *PSRWORD;

Identifies a unique word for a grammar's vocabulary.

dwSize

Size of SRWORD plus the size of szWord (string) rounded up to the nearest multiple of four. The dwSize member must be DWORD-aligned to work on processors that require alignment, such as MIPS® and Alpha APX™.

dwWordNum

Unique word identifier specific to this grammar. The same string can have a different word identifier in different grammars or in the same grammar if the word participates in the grammar in different ways. For example, the noun "project" and the verb "project" each would have a unique word identifier within the same grammar.

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.

szWord

Null-terminated string of variable size containing alphabetic characters and intra-word punctuation. The null at the end of the string is sufficient to indicate the end of the string.

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" "E".

Certain languages such as Japanese use two character: 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 deduced easily from the symbols that represent the word. 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. For example, the Japanese names Honcho and Motomachi are pronounced differently but "spelled" with the same kanji characters.