CNssSpeechItemTrainer Class Reference

class CNssSpeechItemTrainer : public CBase

The CNssSpeechItemTrainer class builds SpeechItem instances when requested.

NssVASApi.lib
Since
2.8

Inherits from

Public Member Functions
~CNssSpeechItemTrainer ()
TBool CheckContext ( CNssContext &)
TBool CheckTrainingParametersL (const CNssTrainingParameters *)
void CleanUpTraining ()
TInt CommitSIUpdate ()
TInt CreateSrsApi ()
void DeleteNextTag ()
TInt DeleteTagDelayed ( MNssDeleteTagClient *, CNssTag &)
void DoDeleteGroupedTags ()
void DoDeleteTags ()
void DoRetrainAddVoiceTags ()
void DoRetrainTextDelayed ()
void DoSaveTags ()
void DoTrainTextDelayed ()
void FinishDeleteTags ( TInt )
TBool GrammarIdBufferNeeded ()
void HandleGrammarCreated ( TInt )
void HandleLexiconCreated ( TInt )
void HandleRemoveTagComplete ()
void HandleRemoveTagFailed ( TInt )
void HandleRemoveTagsComplete ()
void HandleRetrainComplete ( TInt )
void HandleTrainComplete ( TInt )
void HandleTrainError ( RPointerArray < CNssSpeechItem > *&)
void MsruoEvent ( TUid , TInt )
CNssSpeechItemTrainer * NewL ( CNssVASDatabase *)
CNssSpeechItemTrainer * NewLC ( CNssVASDatabase *)
void RemoveTagsFinished ( TInt )
void RemoveTagsFromVAS ()
void RestartTimer ()
MNssSpeechItem::TNssSpeechItemResult RetrainTextDelayed ( MNssTrainTextEventHandler *, CNssTrainingParameters *, CNssSpeechItem &, CNssContext &)
void RunBufferedActionsL ()
TInt SaveTagDelayed ( MNssSaveTagClient *, CNssTag &)
void SendTrainingCallbacks ( TInt )
TBool SpeechItemBufferNeeded ()
TInt SpeechItems2Phrases ( RPointerArray < CNssSpeechItem > &, RPointerArray < MDesCArray > &)
CDesC16ArrayFlat * SplitPhraseL (const TDesC &, TChar )
MNssSpeechItem::TNssSpeechItemResult TrainTextDelayed ( MNssTrainTextEventHandler *, CNssTrainingParameters *, CNssSpeechItem &, CNssContext &)
TInt UncommitSIUpdate ()
Private Member Functions
CNssSpeechItemTrainer ( CNssVASDatabase *)
void ConstructL ()
void SetState ( TTrainState )
CDesC16ArrayFlat * SplitPhraseSindeL (const TDesC &, TChar )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CNssTrainingActionTracker * iActionTracker
CNssContext * iContext
CNssVASDatabase * iDatabase
MNssDeleteTagClient * iDeleteEventHandler
RArray < TUint32 > * iDeleteRuleIDArray
TUint32 iGrammarId
RArray < TUint32 > * iGrammarIdBuffer
RArray < TUint32 > * iGrammarIdDeletingBuffer
TUint32 iLexiconId
RPointerArray < MDesCArray > iPhraseArray
RArray < TUint32 > * iRuleIDArray
MNssSaveTagClient * iSaveEventHandler
RPointerArray < CNssSpeechItem > * iSpeechItemBuffer
RPointerArray < CNssSpeechItem > * iSpeechItemTrainingBuffer
CNssSiUtilityWrapper * iSrsApi
TTrainState iState
RPointerArray < CNssTag > * iTagBuffer
RPointerArray < CNssTag > * iTagDeleteBuffer
TInt iTagDeleteCounter
MNssTrainTextEventHandler * iTrainEventHandler
CNssTrainingParameters * iTrainingParams

Constructor & Destructor Documentation

CNssSpeechItemTrainer(CNssVASDatabase *)

CNssSpeechItemTrainer ( CNssVASDatabase * aDatabase ) [private]

C++ constructor

Parameters

CNssVASDatabase * aDatabase

~CNssSpeechItemTrainer()

~CNssSpeechItemTrainer ( )

Destructor. The CNssSpeechItemTrainer destructor Destroys the speech item trainer.

Member Functions Documentation

CheckContext(CNssContext &)

TBool CheckContext ( CNssContext & aContext )

Parameters

CNssContext & aContext

CheckTrainingParametersL(const CNssTrainingParameters *)

TBool CheckTrainingParametersL ( const CNssTrainingParameters * aParams )

Parameters

const CNssTrainingParameters * aParams

CleanUpTraining()

void CleanUpTraining ( )

CommitSIUpdate()

TInt CommitSIUpdate ( )

ConstructL()

void ConstructL ( ) [private]

Symbian 2nd phase constructor

CreateSrsApi()

TInt CreateSrsApi ( )
Initializes iSrsApi or returns an error.
Since
2.8

DeleteNextTag()

void DeleteNextTag ( )

DeleteTagDelayed(MNssDeleteTagClient *, CNssTag &)

TInt DeleteTagDelayed ( MNssDeleteTagClient * aDeleteTagClient,
CNssTag & aTag
)

Queue a tag for removal.

Parameters

MNssDeleteTagClient * aDeleteTagClient callback to call after deleting / failing to delete.
CNssTag & aTag tag to be removed

DoDeleteGroupedTags()

void DoDeleteGroupedTags ( )

DoDeleteTags()

void DoDeleteTags ( )

DoRetrainAddVoiceTags()

void DoRetrainAddVoiceTags ( )

DoRetrainTextDelayed()

void DoRetrainTextDelayed ( )

DoSaveTags()

void DoSaveTags ( )

DoTrainTextDelayed()

void DoTrainTextDelayed ( )

FinishDeleteTags(TInt)

void FinishDeleteTags ( TInt aSuccess )

Parameters

TInt aSuccess

GrammarIdBufferNeeded()

TBool GrammarIdBufferNeeded ( )

HandleGrammarCreated(TInt)

void HandleGrammarCreated ( TInt aError )

Parameters

TInt aError

HandleLexiconCreated(TInt)

void HandleLexiconCreated ( TInt aError )

Parameters

TInt aError

HandleRemoveTagComplete()

void HandleRemoveTagComplete ( )

HandleRemoveTagFailed(TInt)

void HandleRemoveTagFailed ( TInt aError )

Parameters

TInt aError

HandleRemoveTagsComplete()

void HandleRemoveTagsComplete ( )

HandleRetrainComplete(TInt)

void HandleRetrainComplete ( TInt aResult )

Parameters

TInt aResult

HandleTrainComplete(TInt)

void HandleTrainComplete ( TInt aResult )

Parameters

TInt aResult

HandleTrainError(RPointerArray< CNssSpeechItem > *&)

void HandleTrainError ( RPointerArray < CNssSpeechItem > *& anItemArray )

Parameters

RPointerArray < CNssSpeechItem > *& anItemArray

MsruoEvent(TUid, TInt)

void MsruoEvent ( TUid aEvent,
TInt aResult
) [virtual]

Parameters

TUid aEvent
TInt aResult

NewL(CNssVASDatabase *)

CNssSpeechItemTrainer * NewL ( CNssVASDatabase * aDatabase ) [static]
Creates CNssSpeechItemTrainer .
Since
2.8

Parameters

CNssVASDatabase * aDatabase VAS database object

NewLC(CNssVASDatabase *)

CNssSpeechItemTrainer * NewLC ( CNssVASDatabase * aDatabase ) [static]
Creates CNssSpeechItemTrainer . Pushes it to the cleanup stack.
Since
2.8

Parameters

CNssVASDatabase * aDatabase VAS database object

RemoveTagsFinished(TInt)

void RemoveTagsFinished ( TInt aSuccess )
Cleanup/error handler function for Delayed Remove operation.
Since
2.8

Parameters

TInt aSuccess Success status of remove tags

RemoveTagsFromVAS()

void RemoveTagsFromVAS ( )

RestartTimer()

void RestartTimer ( )

RetrainTextDelayed(MNssTrainTextEventHandler *, CNssTrainingParameters *, CNssSpeechItem &, CNssContext &)

MNssSpeechItem::TNssSpeechItemResult RetrainTextDelayed ( MNssTrainTextEventHandler * aEventHandler,
CNssTrainingParameters * aTrainingParams,
CNssSpeechItem & aSpeechItem,
CNssContext & aContext
)
Adds a names to the queue of names to be trained. These names are actually trained after a delay. Calling this function resets the delay timer.
Since
2.8

Parameters

MNssTrainTextEventHandler * aEventHandler Callback after the names have been trained
CNssTrainingParameters * aTrainingParams Parameters for training
CNssSpeechItem & aSpeechItem Speech item to be trained
CNssContext & aContext Context, to which the speech item belongs.

RunBufferedActionsL()

void RunBufferedActionsL ( )

SaveTagDelayed(MNssSaveTagClient *, CNssTag &)

TInt SaveTagDelayed ( MNssSaveTagClient * aSaveTagClient,
CNssTag & aTag
)
Queue a tag for saving.
Since
2.8

Parameters

MNssSaveTagClient * aSaveTagClient callback to call after saving / failing to save.
CNssTag & aTag tag to be saved

SendTrainingCallbacks(TInt)

void SendTrainingCallbacks ( TInt aResult )
Cleans up training/retraining and sends the callbacks to the client.
Since
2.8

Parameters

TInt aResult Was training successful or not.

SetState(TTrainState)

void SetState ( TTrainState aState ) [private]

Set the train state. This is the place to check any state-related invariants and/or print state switching related info in UDEB

Parameters

TTrainState aState

SpeechItemBufferNeeded()

TBool SpeechItemBufferNeeded ( )

SpeechItems2Phrases(RPointerArray< CNssSpeechItem > &, RPointerArray< MDesCArray > &)

TInt SpeechItems2Phrases ( RPointerArray < CNssSpeechItem > & aSpeechItems,
RPointerArray < MDesCArray > & aPhrases
)

Parameters

RPointerArray < CNssSpeechItem > & aSpeechItems
RPointerArray < MDesCArray > & aPhrases

SplitPhraseL(const TDesC &, TChar)

CDesC16ArrayFlat * SplitPhraseL ( const TDesC & aPhrase,
TChar aSeparator
)

Parameters

const TDesC & aPhrase
TChar aSeparator

SplitPhraseSindeL(const TDesC &, TChar)

CDesC16ArrayFlat * SplitPhraseSindeL ( const TDesC & aPhrase,
TChar aSeparator
) [private]

Parameters

const TDesC & aPhrase
TChar aSeparator

TrainTextDelayed(MNssTrainTextEventHandler *, CNssTrainingParameters *, CNssSpeechItem &, CNssContext &)

MNssSpeechItem::TNssSpeechItemResult TrainTextDelayed ( MNssTrainTextEventHandler * aEventHandler,
CNssTrainingParameters * aTrainingParams,
CNssSpeechItem & aSpeechItem,
CNssContext & aContext
)
Adds a names to the queue of names to be trained. These names are actually trained after a delay. Calling this function resets the delay timer.
Since
2.8

Parameters

MNssTrainTextEventHandler * aEventHandler Callback after the names have been trained
CNssTrainingParameters * aTrainingParams Parameters for training
CNssSpeechItem & aSpeechItem Speech item to be trained
CNssContext & aContext Context, to which the speech item belongs.

UncommitSIUpdate()

TInt UncommitSIUpdate ( )

Member Data Documentation

CNssTrainingActionTracker * iActionTracker

CNssTrainingActionTracker * iActionTracker [private]

CNssContext * iContext

CNssContext * iContext [private]

CNssVASDatabase * iDatabase

CNssVASDatabase * iDatabase [private]

MNssDeleteTagClient * iDeleteEventHandler

MNssDeleteTagClient * iDeleteEventHandler [private]

RArray< TUint32 > * iDeleteRuleIDArray

RArray < TUint32 > * iDeleteRuleIDArray [private]

TUint32 iGrammarId

TUint32 iGrammarId [private]

RArray< TUint32 > * iGrammarIdBuffer

RArray < TUint32 > * iGrammarIdBuffer [private]

RArray< TUint32 > * iGrammarIdDeletingBuffer

RArray < TUint32 > * iGrammarIdDeletingBuffer [private]

TUint32 iLexiconId

TUint32 iLexiconId [private]

RPointerArray< MDesCArray > iPhraseArray

RPointerArray < MDesCArray > iPhraseArray [private]

RArray< TUint32 > * iRuleIDArray

RArray < TUint32 > * iRuleIDArray [private]

MNssSaveTagClient * iSaveEventHandler

MNssSaveTagClient * iSaveEventHandler [private]

RPointerArray< CNssSpeechItem > * iSpeechItemBuffer

RPointerArray < CNssSpeechItem > * iSpeechItemBuffer [private]

RPointerArray< CNssSpeechItem > * iSpeechItemTrainingBuffer

RPointerArray < CNssSpeechItem > * iSpeechItemTrainingBuffer [private]

CNssSiUtilityWrapper * iSrsApi

CNssSiUtilityWrapper * iSrsApi [private]

TTrainState iState

TTrainState iState [private]

RPointerArray< CNssTag > * iTagBuffer

RPointerArray < CNssTag > * iTagBuffer [private]

RPointerArray< CNssTag > * iTagDeleteBuffer

RPointerArray < CNssTag > * iTagDeleteBuffer [private]

TInt iTagDeleteCounter

TInt iTagDeleteCounter [private]

MNssTrainTextEventHandler * iTrainEventHandler

MNssTrainTextEventHandler * iTrainEventHandler [private]

CNssTrainingParameters * iTrainingParams

CNssTrainingParameters * iTrainingParams [private]