Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <SpeechRecognitionDataDevASR.h>
Link against: speechrecognitiondata.lib
This item is not part of the S60 5th Edition SDK

Class CSDGrammar

class CSDGrammar : public CBase;

Description

Class to encapsulate a Speaker Dependent Grammar.

A grammar consists of a list of rules.

Derivation

Members

Defined in CSDGrammar:

Inherited from CBase:


Construction and destruction


~CSDGrammar()

IMPORT_C ~CSDGrammar();

Description

Destructor.


NewL(TGrammarID)

IMPORT_C static CSDGrammar* NewL(TGrammarID aGrammarID);

Description

Instantiates an instance of CSDGrammar.

Parameters

TGrammarID aGrammarID

The grammar identifier.

Return value

CSDGrammar *

A pointer to a CSDGrammar object.


NewLC(TGrammarID)

IMPORT_C static CSDGrammar* NewLC(TGrammarID aGrammarID);

Description

Instantiates an instance of CSDGrammar and leaves a pointer on the cleanup stack.

Parameters

TGrammarID aGrammarID

The grammar identifier.

Return value

CSDGrammar *

A pointer to CSDGrammar object.

[Top]


Member functions


GrammarID()const

IMPORT_C TGrammarID GrammarID() const;

Description

Returns the grammar ID of the result.

Return value

TGrammarID

The grammar identifier.


Add(CSDRule &)

IMPORT_C TInt Add(CSDRule &aRule);

Description

Adds a rule to the grammar.

Parameters

CSDRule &aRule

A reference to a CSDRule object.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


Delete(TRuleID)

IMPORT_C void Delete(TRuleID aRuleID);

Description

Deletes a rule from the grammar.

Parameters

TRuleID aRuleID

The rule identifier to delete.


At(TInt)const

IMPORT_C const CSDRule& At(TInt aIndex) const;

Description

Returns a rule based at an index.

Parameters

TInt aIndex

An index value. The value must not be negative and must not be greater than the number of rules currently in the grammar, otherwise the function will panic.

Return value

const CSDRule &

A reference to a CSDRule object.


FindRule(TRuleID)const

IMPORT_C TInt FindRule(TRuleID aRuleID) const;

Description

Finds a rule in the grammar based on the rule ID.

Parameters

TRuleID aRuleID

The rule identifier.

Return value

TInt

The index of the first matching rule within the grammar. Returns KErrNotFound, if a matching rule can not be found.


Count()const

IMPORT_C TInt Count() const;

Description

Returns the number of rules in the grammar

Return value

TInt

The number of rules.