本文整理汇总了C++中CSentence::MarkNewPhraseBase方法的典型用法代码示例。如果您正苦于以下问题:C++ CSentence::MarkNewPhraseBase方法的具体用法?C++ CSentence::MarkNewPhraseBase怎么用?C++ CSentence::MarkNewPhraseBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSentence
的用法示例。
在下文中一共展示了CSentence::MarkNewPhraseBase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractPhonemes
//.........这里部分代码省略.........
{
SPINTERFERENCE interference = spEvent.Interference();
switch ( interference )
{
case SPINTERFERENCE_NONE:
pfnPrint( "[ I None ]\r\n" );
break;
case SPINTERFERENCE_NOISE:
pfnPrint( "[ I Noise ]\r\n" );
break;
case SPINTERFERENCE_NOSIGNAL:
pfnPrint( "[ I No Signal ]\r\n" );
break;
case SPINTERFERENCE_TOOLOUD:
pfnPrint( "[ I Too Loud ]\r\n" );
break;
case SPINTERFERENCE_TOOQUIET:
pfnPrint( "[ I Too Quiet ]\r\n" );
break;
case SPINTERFERENCE_TOOFAST:
pfnPrint( "[ I Too Fast ]\r\n" );
break;
case SPINTERFERENCE_TOOSLOW:
pfnPrint( "[ I Too Slow ]\r\n" );
break;
default:
break;
}
}
break;
case SPEI_PHRASE_START:
pfnPrint( "Phrase Start\r\n" );
sentence.MarkNewPhraseBase();
break;
case SPEI_HYPOTHESIS:
case SPEI_RECOGNITION:
case SPEI_FALSE_RECOGNITION:
{
CComPtr<ISpRecoResult> cpResult;
cpResult = spEvent.RecoResult();
CSpDynamicString dstrText;
if (spEvent.eEventId == SPEI_FALSE_RECOGNITION)
{
dstrText = L"(Unrecognized)";
result = SR_RESULT_FAILED;
// It's possible that the failed recog might have more words, so see if that's the case
EnumeratePhonemes( cpPhoneConv, cpResult, sentence );
}
else
{
// Hypothesis or recognition success
cpResult->GetText( (ULONG)SP_GETWHOLEPHRASE, (ULONG)SP_GETWHOLEPHRASE, TRUE, &dstrText, NULL);
EnumeratePhonemes( cpPhoneConv, cpResult, sentence );
if ( spEvent.eEventId == SPEI_RECOGNITION )
{
result = SR_RESULT_SUCCESS;
}
pfnPrint( va( "%s%s\r\n", spEvent.eEventId == SPEI_HYPOTHESIS ? "[ Hypothesis ] " : "", dstrText.CopyToChar() ) );