Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Speech Recognition Manager /
Chapter 1 - Speech Recognition Manager / Speech Recognition Manager Reference
Speech Recognition Manager Routines / Creating Language Objects


SRNewLanguageModel

You can use the SRNewLanguageModel function to create a new language model.

pascal OSErr SRNewLanguageModel (
SRRecognitionSystem system, 
SRLanguageModel *model, 
const void *name, 
Size nameLength);
system
A recognition system.
model
On exit, a reference to a new empty language model associated with the specified recognition system.
name
The address of a buffer that contains the name of the language model. By convention, this name should begin with the character "<" and end with the character ">".
nameLength
The size, in bytes, of the specified name.
DESCRIPTION
The SRNewLanguageModel function returns, in the model parameter, a reference to a new language model associated with the recognition system specified by the system parameter. The new language model is initially empty and has the name specified by the name and nameLength parameters. The name of the language model should be unique among all the language models your application creates, and it should be comprehensible to users. (For example, a language model that defined a list of names might be called "<Names>").

Note
The convention that language model names begin with the character "<" and end with the character ">" is adopted to support future utilities that display the names of language models to the user (perhaps as part of showing the user what he or she can say).
You can add language objects (that is, words, phrases, paths, and other language models) to a language model by calling the SRAddText and SRAddLanguageObject functions.

SPECIAL CONSIDERATIONS
SRNewLanguageModel sets the reference count of the specified language model to 1. You should call the SRReleaseObject function to release the language model reference returned by SRNewLanguageModel when you're done using it.

SEE ALSO
You can get or set the name of an existing language model by calling the SRGetProperty or SRSetProperty functions with the kSRSpelling property selector.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
22 JAN 1997