Carbon


SRNewLanguageModel

Header: SpeechRecognition.h Carbon status: Supported

Creates a new language model.

OSErr SRNewLanguageModel (
    SRRecognitionSystem system, 
    SRLanguageModel *model, 
    const void *name, 
    Size nameLength
);
Parameter descriptions
system

A recognition system.

model

On return, a reference to a new empty language model associated with the specified recognition system.

name

A pointer to a buffer that contains the name of the language model. 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 “”).

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).

nameLength

The size, in bytes, of the specified name.

function result

A result code.

DISCUSSION

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.

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 are done using it.

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

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/10/2000)