pocketsphinx-android
pocketsphinx-android copied to clipboard
Handle an error, when phrase not contains words from JSGF
Hello. Please help me. How to handle an error, when phrase not contains words from JSGF? In the logcat a see next:
ERROR: "fsg_search.c", line 910: Final result does not match the grammar in frame 155.
I want handle this error and I want say: "Sorry, I didn’t recognize what you said. Please, say again."
You probably should get null in onResult() callback.
On Wed, Nov 26, 2014 at 7:41 PM, Den [email protected] wrote:
Hello. Please help me. How to handle an error, when phrase not contains words from JSGF? In the logcat a see next:
ERROR: "fsg_search.c", line 910: Final result does not match the grammar in frame 155.
I want handle this error and I want say: "Sorry, I didn’t recognize what you said. Please, say again."
— Reply to this email directly or view it on GitHub https://github.com/cmusphinx/pocketsphinx-android/issues/10.
Sincerely, Alexander
As suggested by @mbait, following code-segment helps to handle segfault on this issue:
..
..
//get hypothesis
int score = 0;
const char* hyp = ps_get_hyp(decoder, &score);
if ( hyp != NULL){
std::cout<<"(Hyp, Score) : ("<<hyp<<","<<score<<")"<<std::endl;
}
//next recognition cycle
status = ps_start_utt(decoder);
..
..