I have an issue with collecting the combination of four digits (persons id) using pocketsphinx c program code. All of my other commands are detected and operated correctly. But i dont know how to create a conditional statement which will be selected when a string of possible four digit combination is detected. Kindly suggest how can i do it !!
printf("Processing...\n");
fflush(stdout);
/* Finish decoding, obtain and print result */
ps_end_utt(ps);
hyp = ps_get_hyp(ps, NULL, &uttid);
//printf("%s: %s\n", uttid, hyp);
fflush(stdout);
if (hyp) {
sscanf(hyp, "%s", word);
if (strcmp(hyp, "LASCHE FAHRPLAN") == 0) {
counter_correct = counter_correct + 1;
printf("LASCHE FAHRPLAN is confirmed\n");
printf("The correct number of utterances calculated %d, Total number of utterances calculated %s \n",counter_correct,uttid);
}
else if (strcmp(hyp, "LASCHE VORSCHAU") == 0) {
counter_correct = counter_correct + 1;
printf("LASCHE VORSCHAU is confirmed \n");
printf("The correct number of utterances calculated %d, Total number of utterances calculated %s \n",counter_correct,uttid);
}
similarly i want to detect the strings like '1 2 3 4' , '3 7 8 9' (all possible combination of four digits) which are also generated at variable hyp [ printf("%s: %s\n", uttid, hyp); ] How should i make the conditional loop for this case.
Thank you for your help.