摘要 |
One embodiment of the present invention provides a system that facilitates recognizing voice input. During operation, the system receives a document that includes a specification of a datatype for which there exists a predefined grammar. The system also obtains a locale attribute for the datatype, wherein the locale attribute identifies a version of a language that is spoken in a locale. Next, the system uses the locale attribute to lookup a locale-specific grammar for the datatype, and then communicates the locale-specific grammar to a speech recognition engine, thereby allowing the speech recognition engine to use the locale-specific grammar to recognize voice input for the datatype. |