I have implemented a recognizer intent like this.
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Tell me stuff");
startActivityForResult(intent, REQUEST_CODE);
With a return like this
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)
{
ArrayList<String> matches = data.getStringArrayListExtra(
RecognizerIntent.EXTRA_RESULTS);
}
What I would like to do with this data is implement simple grammar rules with numbers. For example something like this
if(matches.contains("my number is"))
{
string number = matches.getNextWord();
//Then parse the string into an integer
}
Obviously this code doesn't work but I'm wondering if anyone has a solution for this as a Google search yielded absolutely nothing. Thanks for any help