SRWORD

This structure identifies a unique word for a grammar’s vocabulary.

Syntax

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

Members

dwSize
Specifies the size of SRWORD plus the size of szWord rounded up to the nearest multiple of 4. The dwSize member must be DWORD-aligned to work on processors that require alignment, such as MIPS® and Alpha APX™.
dwWordNum
Specifies a 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 that contains alphabetic characters and intraword punctuation. The NULL 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” 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.