CNssRecognitionHandler Class Reference

class CNssRecognitionHandler : public CBase

The CNssRecognitionHandler class performs the recognition function.

NssVASApi.lib
Since
2.8

Inherits from

  • CNssRecognitionHandler

Nested Classes and Structures

Public Member Functions
~CNssRecognitionHandler()
voidAdaptL(MNssAdaptationEventHandler *, CSIClientResultSet *, TInt)
TNssRecognitionResultCancel()
MNssAdaptationItem *GetAdaptationItemL()
voidMsruoEvent(TUid, TInt)
CNssRecognitionHandler *NewL()
CNssRecognitionHandler *NewLC()
TNssRecognitionResultPreStartSampling(MNssRecognizeInitCompleteHandler *)
TNssRecognitionResultRecognize(MNssRecognizeEventHandler *)
TNssRecognitionResultRecognizeInitL(MNssRecognizeInitCompleteHandler *, const CArrayPtrFlat< MNssContext > &, TInt)
TNssRecognitionResultRecognizeInitL(MNssRecognizeInitCompleteHandler *, TInt)
TNssRecognitionResultRejectTagL(MNssRejectTagCompleteHandler *, CArrayPtrFlat< MNssTag > *)
voidRemoveAdaptationItem(CNssAdaptationItem *)
TNssRecognitionResultSelectTagL(MNssTag *)
TNssRecognitionResultSelectTagL(MNssTag *, TBool)
Private Member Functions
CNssRecognitionHandler()
voidCleanup()
voidCleanupRecognizeFailed()
voidCleanupRecognizeInitFailed()
voidCleanupRejectTagFailed()
voidClearContextList()
voidClearContextStatus()
voidClearRuleList()
voidClearTagList()
MNssRecognitionHandler::TNssRecognitionResult CommonRecognizeInitL(MNssRecognizeInitCompleteHandler *, TInt)
voidConstructL()
voidCreateSrfL()
voidDeleteSrf()
voidDoEouDetected()
voidDoLoadGrammarComplete()
voidDoLoadGrammarFailed()
voidDoLoadLexiconComplete()
voidDoLoadLexiconFailed()
voidDoLoadModelsComplete()
voidDoLoadModelsFailed()
voidDoPreStartSamplingComplete(TInt)
voidDoRecognitionComplete()
voidDoRecognitionFailed()
voidDoRecognitionFailedNoMatch()
voidDoRecognitionFailedNoSpeech(TInt)
voidDoRecognitionReady()
voidDoRecordFailed(TInt)
voidDoRecordStarted()
voidDoUnloadRuleComplete()
voidDoUnloadRuleFailed()
voidHandleTagCheckL()
voidUnexpectedEvent()
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()
Public Member Enumerations
enumTNssRState {
EVasIdle, EVasWaitingForLoadModelsComplete, EVasWaitingForLoadLexiconComplete, EVasWaitingForLoadGrammarComplete, EVasWaitingForRecognitionReadyRecognitionInit, EVasWaitingForRecognize, EVasWaitingForRecordStarted, EVasWaitingForEouDetected, EVasWaitingForRecognitionComplete, EVasWaitingForSelectTag, EVasWaitingForUnloadRuleComplete, EVasWaitingForRecognitionReadyRejectTag, EVasDirectAdaptation, EVasIdleAdaptation, EVasCorrectingPluginDatabase
}
Private Attributes
RPointerArray< CNssAdaptationItem >iAdaptItemArray
MNssAdaptationEventHandler *iAdaptationHandler
TInt iContextCount
TInt iContextCurrentLoopCount
TMNssContextList *iContextList
CNssContextMgr *iContextMgr
CArrayFixFlat< TBool > *iContextStatus
MNssRecognizeEventHandler *iEventHandler
MNssRecognizeInitCompleteHandler *iInitCompleteHandler
TInt iMaxResults
TNssRState iRState
MNssRejectTagCompleteHandler *iRejectTagCompleteHandler
TInt iRejectTagCount
TInt iRejectTagCurrentLoopCount
CArrayFixFlat< TRuleEntry > *iRuleList
CSIClientResultSet *iSIClientResultSet
CNssSiUtilityWrapper *iSrsApi
TInt iTagCount
TInt iTagCurrentLoopCount
CArrayPtrFlat< CNssTag > *iTagList
CNssTagMgr *iTagMgr
CNssVASDBBuilder *iVasDBBuilder
CActiveSchedulerWait iWait

Constructor & Destructor Documentation

CNssRecognitionHandler()

CNssRecognitionHandler()[private]

Constructor.

~CNssRecognitionHandler()

~CNssRecognitionHandler()[virtual]

Destructor.

Member Functions Documentation

AdaptL(MNssAdaptationEventHandler *, CSIClientResultSet *, TInt)

voidAdaptL(MNssAdaptationEventHandler *aCallback,
CSIClientResultSet *aResultSet,
TIntaCorrect
)
AdaptL - called by adaptation item. Adapts the acoustic models.
Since
2.0

Parameters

MNssAdaptationEventHandler * aCallback
CSIClientResultSet * aResultSet
TInt aCorrect

Cancel()

TNssRecognitionResultCancel()
From MNssRecognitionHandler Interface Cancel the last recognition function.
Since
2.0

Cleanup()

voidCleanup()[private]

Perform required cleanup to get back to the EIdle state

CleanupRecognizeFailed()

voidCleanupRecognizeFailed()[private]

Perform required cleanup to get back to the EIdle state and issue the HandleRecognizeError event with RecognizeFailed error code

CleanupRecognizeInitFailed()

voidCleanupRecognizeInitFailed()[private]

Perform required cleanup to get back to the EIdle state and issue the HandleRecognizeInitError event with RecognizeInitFailed error code

CleanupRejectTagFailed()

voidCleanupRejectTagFailed()[private]

Perform required cleanup to get back to the EIdle state and issue the HandleRejectTagError event with RejectTagFailed error code

ClearContextList()

voidClearContextList()[private]

Delete context objects from iContextList

ClearContextStatus()

voidClearContextStatus()[private]

Delete entries from iContextStatus

ClearRuleList()

voidClearRuleList()[private]

Delete the TRuleEntry objects from iRuleList

ClearTagList()

voidClearTagList()[private]

Delete the tag objects from iTagList

CommonRecognizeInitL(MNssRecognizeInitCompleteHandler *, TInt)

MNssRecognitionHandler::TNssRecognitionResult CommonRecognizeInitL(MNssRecognizeInitCompleteHandler *aInitCompleteHandler,
TIntaMaxResults
)[private]

Perform those RecognizeInitL tasks, which do not depend on vocabulary.

Parameters

MNssRecognizeInitCompleteHandler * aInitCompleteHandler
TInt aMaxResults

ConstructL()

voidConstructL()[private]

By default Symbian 2nd phase constructor is private.

CreateSrfL()

voidCreateSrfL()[private]

Create the SRF object, iSrsApi.

DeleteSrf()

voidDeleteSrf()[private]

Gracefully terminate and delete the SRF object, iSrsApi.

DoEouDetected()

voidDoEouDetected()[private]

Handle EouDetected SRF event

DoLoadGrammarComplete()

voidDoLoadGrammarComplete()[private]

Handle LoadGrammarComplete SRF event

DoLoadGrammarFailed()

voidDoLoadGrammarFailed()[private]

Handle LoadGrammarFailed SRF event

DoLoadLexiconComplete()

voidDoLoadLexiconComplete()[private]

Handle LoadLexiconComplete SRF event

DoLoadLexiconFailed()

voidDoLoadLexiconFailed()[private]

Handle LoadLexiconFailed SRF event

DoLoadModelsComplete()

voidDoLoadModelsComplete()[private]

Handle LoadModelsComplete SRF event

DoLoadModelsFailed()

voidDoLoadModelsFailed()[private]

Handle LoadModelsFailed SRF event

DoPreStartSamplingComplete(TInt)

voidDoPreStartSamplingComplete(TIntaError)[private]

Handle PreStartSampling SRSF event

Parameters

TInt aError

DoRecognitionComplete()

voidDoRecognitionComplete()[private]

Handle RecognitionComplete SRF event

DoRecognitionFailed()

voidDoRecognitionFailed()[private]

Handle RecognitionFailed SRF event

DoRecognitionFailedNoMatch()

voidDoRecognitionFailedNoMatch()[private]

Handle RecognitionFailedNoMatch SRF event

DoRecognitionFailedNoSpeech(TInt)

voidDoRecognitionFailedNoSpeech(TIntaResult)[private]

Handle RecognitionFailedNoSpeech, RecognitionFailedTooEarly, RecognitionFailedTooLong, and RecognitionFailedTooShort SRF events

Parameters

TInt aResultThe Msruo event Result code.

DoRecognitionReady()

voidDoRecognitionReady()[private]

Handle RecognitionReady SRF event

DoRecordFailed(TInt)

voidDoRecordFailed(TIntaResult)[private]

Handle RecordFailed SRF event

Parameters

TInt aResultThe Msruo event Result code.

DoRecordStarted()

voidDoRecordStarted()[private]

Handle RecordStarted SRF event

DoUnloadRuleComplete()

voidDoUnloadRuleComplete()[private]

Handle UnloadRuleComplete SRF event

DoUnloadRuleFailed()

voidDoUnloadRuleFailed()[private]

Handle UnloadRuleFailed SRF event

GetAdaptationItemL()

MNssAdaptationItem *GetAdaptationItemL()
From MNssRecognitionHandler Interface Get the adaptation item to adapt, when you know whether the result was correct or not.
Since
2.0

HandleTagCheckL()

voidHandleTagCheckL()[private]

Handle Tag Check for contexts

MsruoEvent(TUid, TInt)

voidMsruoEvent(TUidaEvent,
TIntaResult
)
From MSpeechRecognitionEvent Interface Handle Speech Recognition Utility event
Since
2.0

Parameters

TUid aEventThe event callback to receive Speech Recognition Utility events.
TInt aResultThe result value associated with aEvent.

NewL()

CNssRecognitionHandler *NewL()[static]

Two-phased constructor.

NewLC()

CNssRecognitionHandler *NewLC()[static]

Two-phased constructor.

PreStartSampling(MNssRecognizeInitCompleteHandler *)

TNssRecognitionResultPreStartSampling(MNssRecognizeInitCompleteHandler *aInitCompleteHandler)

From MNssRecognitionHandler Starts sampling already before RecognizeInitL and Recognize calls. This is used to ensure that there is no delay between user notification and sampling start.

Since
3.2

Parameters

MNssRecognizeInitCompleteHandler * aInitCompleteHandlerCallback handler

Recognize(MNssRecognizeEventHandler *)

TNssRecognitionResultRecognize(MNssRecognizeEventHandler *aEventHandler)
From MNssRecognitionHandler Interface Perform the recognize function.
Since
2.0

Parameters

MNssRecognizeEventHandler * aEventHandlerThe event call back to receive recognize events.

RecognizeInitL(MNssRecognizeInitCompleteHandler *, const CArrayPtrFlat< MNssContext > &, TInt)

TNssRecognitionResultRecognizeInitL(MNssRecognizeInitCompleteHandler *aInitCompleteHandler,
const CArrayPtrFlat< MNssContext > &aRecognitionVocabulary,
TIntaMaxResults
)
Perform initialization for the recognize funtion.
Since
2.0

Parameters

MNssRecognizeInitCompleteHandler * aInitCompleteHandlerThe event call back to receive recognize init events.
const CArrayPtrFlat< MNssContext > & aRecognitionVocabularyList of context, which are active in recognition.
TInt aMaxResultsThe maximum number of voice tags to be recognized.

RecognizeInitL(MNssRecognizeInitCompleteHandler *, TInt)

TNssRecognitionResultRecognizeInitL(MNssRecognizeInitCompleteHandler *aInitCompleteHandler,
TIntaMaxResults
)
Perform initialization for the recognize funtion. Automatically loads the commands and the names as recognition vocabulary.
Since
2.0

Parameters

MNssRecognizeInitCompleteHandler * aInitCompleteHandlerThe event call back to receive recognize init events.
TInt aMaxResultsThe maximum number of voice tags to be recognized.

RejectTagL(MNssRejectTagCompleteHandler *, CArrayPtrFlat< MNssTag > *)

TNssRecognitionResultRejectTagL(MNssRejectTagCompleteHandler *aRejectTagCompleteHandler,
CArrayPtrFlat< MNssTag > *aClientTagList
)
Request Reject Tag, i.e. blacklisting.
Since
2.0

Parameters

MNssRejectTagCompleteHandler * aRejectTagCompleteHandler
CArrayPtrFlat< MNssTag > * aClientTagListThe list of voice tags which is to be rejected, i.e. blacklisted. The tag list is owned by the client.

RemoveAdaptationItem(CNssAdaptationItem *)

voidRemoveAdaptationItem(CNssAdaptationItem *anItem)

RemoveAdaptationItem - When an adaptation item is destroyed, it signals to its "host" recognition handler. This way, the host knows to remove it from the list of active adaptation items.

Parameters

CNssAdaptationItem * anItem

SelectTagL(MNssTag *)

TNssRecognitionResultSelectTagL(MNssTag *aClientTag)
From MNssRecognitionHandler Interface Initiate the Select Tag event.
Since
2.0

Parameters

MNssTag * aClientTagThe voice tag which was selected. The tag is owned by the client.

SelectTagL(MNssTag *, TBool)

TNssRecognitionResultSelectTagL(MNssTag *aClientTag,
TBoolaNotifyHandlers
)
From MNssRecognitionHandler Interface Initiate the Select Tag event.
Since
2.0

Parameters

MNssTag * aClientTagThe voice tag which was selected. The tag is owned by the client.
TBool aNotifyHandlersIf false, the global context handlers won't be notified.

UnexpectedEvent()

voidUnexpectedEvent()[private]

Cleanup and determine the correct event handler

Member Enumerations Documentation

Enum TNssRState

Enumerators

EVasIdle
EVasWaitingForLoadModelsComplete
EVasWaitingForLoadLexiconComplete
EVasWaitingForLoadGrammarComplete
EVasWaitingForRecognitionReadyRecognitionInit
EVasWaitingForRecognize
EVasWaitingForRecordStarted
EVasWaitingForEouDetected
EVasWaitingForRecognitionComplete
EVasWaitingForSelectTag
EVasWaitingForUnloadRuleComplete
EVasWaitingForRecognitionReadyRejectTag
EVasDirectAdaptation
EVasIdleAdaptation
EVasCorrectingPluginDatabase

Member Data Documentation

RPointerArray< CNssAdaptationItem > iAdaptItemArray

RPointerArray< CNssAdaptationItem >iAdaptItemArray[private]

MNssAdaptationEventHandler * iAdaptationHandler

MNssAdaptationEventHandler *iAdaptationHandler[private]

TInt iContextCount

TInt iContextCount[private]

TInt iContextCurrentLoopCount

TInt iContextCurrentLoopCount[private]

TMNssContextList * iContextList

TMNssContextList *iContextList[private]

CNssContextMgr * iContextMgr

CNssContextMgr *iContextMgr[private]

CArrayFixFlat< TBool > * iContextStatus

CArrayFixFlat< TBool > *iContextStatus[private]

MNssRecognizeEventHandler * iEventHandler

MNssRecognizeEventHandler *iEventHandler[private]

MNssRecognizeInitCompleteHandler * iInitCompleteHandler

MNssRecognizeInitCompleteHandler *iInitCompleteHandler[private]

TInt iMaxResults

TInt iMaxResults[private]

TNssRState iRState

TNssRState iRState[private]

MNssRejectTagCompleteHandler * iRejectTagCompleteHandler

MNssRejectTagCompleteHandler *iRejectTagCompleteHandler[private]

TInt iRejectTagCount

TInt iRejectTagCount[private]

TInt iRejectTagCurrentLoopCount

TInt iRejectTagCurrentLoopCount[private]

CArrayFixFlat< TRuleEntry > * iRuleList

CArrayFixFlat< TRuleEntry > *iRuleList[private]

CSIClientResultSet * iSIClientResultSet

CSIClientResultSet *iSIClientResultSet[private]

CNssSiUtilityWrapper * iSrsApi

CNssSiUtilityWrapper *iSrsApi[private]

TInt iTagCount

TInt iTagCount[private]

TInt iTagCurrentLoopCount

TInt iTagCurrentLoopCount[private]

CArrayPtrFlat< CNssTag > * iTagList

CArrayPtrFlat< CNssTag > *iTagList[private]

CNssTagMgr * iTagMgr

CNssTagMgr *iTagMgr[private]

CNssVASDBBuilder * iVasDBBuilder

CNssVASDBBuilder *iVasDBBuilder[private]

CActiveSchedulerWait iWait

CActiveSchedulerWait iWait[private]