CNssSpeechItemTrainer Class Reference

class CNssSpeechItemTrainer : public CBase

The CNssSpeechItemTrainer class builds SpeechItem instances when requested.

NssVASApi.lib
Since
2.8

Inherits from

  • CNssSpeechItemTrainer
Public Member Functions
~CNssSpeechItemTrainer()
TBool CheckContext(CNssContext &)
TBool CheckTrainingParametersL(const CNssTrainingParameters *)
voidCleanUpTraining()
TInt CommitSIUpdate()
TInt CreateSrsApi()
voidDeleteNextTag()
TInt DeleteTagDelayed(MNssDeleteTagClient *, CNssTag &)
voidDoDeleteGroupedTags()
voidDoDeleteTags()
voidDoRetrainAddVoiceTags()
voidDoRetrainTextDelayed()
voidDoSaveTags()
voidDoTrainTextDelayed()
voidFinishDeleteTags(TInt)
TBool GrammarIdBufferNeeded()
voidHandleGrammarCreated(TInt)
voidHandleLexiconCreated(TInt)
voidHandleRemoveTagComplete()
voidHandleRemoveTagFailed(TInt)
voidHandleRemoveTagsComplete()
voidHandleRetrainComplete(TInt)
voidHandleTrainComplete(TInt)
voidHandleTrainError(RPointerArray< CNssSpeechItem > *&)
voidMsruoEvent(TUid, TInt)
CNssSpeechItemTrainer *NewL(CNssVASDatabase *)
CNssSpeechItemTrainer *NewLC(CNssVASDatabase *)
voidRemoveTagsFinished(TInt)
voidRemoveTagsFromVAS()
voidRestartTimer()
MNssSpeechItem::TNssSpeechItemResult RetrainTextDelayed(MNssTrainTextEventHandler *, CNssTrainingParameters *, CNssSpeechItem &, CNssContext &)
voidRunBufferedActionsL()
TInt SaveTagDelayed(MNssSaveTagClient *, CNssTag &)
voidSendTrainingCallbacks(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 *)
voidConstructL()
voidSetState(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()

voidCleanUpTraining()

CommitSIUpdate()

TInt CommitSIUpdate()

ConstructL()

voidConstructL()[private]

Symbian 2nd phase constructor

CreateSrsApi()

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

DeleteNextTag()

voidDeleteNextTag()

DeleteTagDelayed(MNssDeleteTagClient *, CNssTag &)

TInt DeleteTagDelayed(MNssDeleteTagClient *aDeleteTagClient,
CNssTag &aTag
)

Queue a tag for removal.

Parameters

MNssDeleteTagClient * aDeleteTagClientcallback to call after deleting / failing to delete.
CNssTag & aTagtag to be removed

DoDeleteGroupedTags()

voidDoDeleteGroupedTags()

DoDeleteTags()

voidDoDeleteTags()

DoRetrainAddVoiceTags()

voidDoRetrainAddVoiceTags()

DoRetrainTextDelayed()

voidDoRetrainTextDelayed()

DoSaveTags()

voidDoSaveTags()

DoTrainTextDelayed()

voidDoTrainTextDelayed()

FinishDeleteTags(TInt)

voidFinishDeleteTags(TIntaSuccess)

Parameters

TInt aSuccess

GrammarIdBufferNeeded()

TBool GrammarIdBufferNeeded()

HandleGrammarCreated(TInt)

voidHandleGrammarCreated(TIntaError)

Parameters

TInt aError

HandleLexiconCreated(TInt)

voidHandleLexiconCreated(TIntaError)

Parameters

TInt aError

HandleRemoveTagComplete()

voidHandleRemoveTagComplete()

HandleRemoveTagFailed(TInt)

voidHandleRemoveTagFailed(TIntaError)

Parameters

TInt aError

HandleRemoveTagsComplete()

voidHandleRemoveTagsComplete()

HandleRetrainComplete(TInt)

voidHandleRetrainComplete(TIntaResult)

Parameters

TInt aResult

HandleTrainComplete(TInt)

voidHandleTrainComplete(TIntaResult)

Parameters

TInt aResult

HandleTrainError(RPointerArray< CNssSpeechItem > *&)

voidHandleTrainError(RPointerArray< CNssSpeechItem > *&anItemArray)

Parameters

RPointerArray< CNssSpeechItem > *& anItemArray

MsruoEvent(TUid, TInt)

voidMsruoEvent(TUidaEvent,
TIntaResult
)[virtual]

Parameters

TUid aEvent
TInt aResult

NewL(CNssVASDatabase *)

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

Parameters

CNssVASDatabase * aDatabaseVAS database object

NewLC(CNssVASDatabase *)

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

Parameters

CNssVASDatabase * aDatabaseVAS database object

RemoveTagsFinished(TInt)

voidRemoveTagsFinished(TIntaSuccess)
Cleanup/error handler function for Delayed Remove operation.
Since
2.8

Parameters

TInt aSuccessSuccess status of remove tags

RemoveTagsFromVAS()

voidRemoveTagsFromVAS()

RestartTimer()

voidRestartTimer()

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 * aEventHandlerCallback after the names have been trained
CNssTrainingParameters * aTrainingParamsParameters for training
CNssSpeechItem & aSpeechItemSpeech item to be trained
CNssContext & aContextContext, to which the speech item belongs.

RunBufferedActionsL()

voidRunBufferedActionsL()

SaveTagDelayed(MNssSaveTagClient *, CNssTag &)

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

Parameters

MNssSaveTagClient * aSaveTagClientcallback to call after saving / failing to save.
CNssTag & aTagtag to be saved

SendTrainingCallbacks(TInt)

voidSendTrainingCallbacks(TIntaResult)
Cleans up training/retraining and sends the callbacks to the client.
Since
2.8

Parameters

TInt aResultWas training successful or not.

SetState(TTrainState)

voidSetState(TTrainStateaState)[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,
TCharaSeparator
)

Parameters

const TDesC & aPhrase
TChar aSeparator

SplitPhraseSindeL(const TDesC &, TChar)

CDesC16ArrayFlat *SplitPhraseSindeL(const TDesC &aPhrase,
TCharaSeparator
)[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 * aEventHandlerCallback after the names have been trained
CNssTrainingParameters * aTrainingParamsParameters for training
CNssSpeechItem & aSpeechItemSpeech item to be trained
CNssContext & aContextContext, 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]