Search code examples
androidspeech-recognitiongrammarspeechcmusphinx

Android text (from speech) interpretation using grammar (w/o using a recognizer)


I use Google Speech Recognizer for Android that I do not want to replace. It produces text, which I want to interpret using my own grammar.

I've checked some tools (like sphinx), but all of them seem to require using their recognizer in order to decode text, but I don't want to use their recognizer.

Do you know some tool that can process a given text using a grammar? Or perhaps how can i use sphinx w/o their recognizer? Thanks


Solution

  • Grammars are equivalent to finite deterministic automata parsing and those are equivalent to regular expressions. So instead of external frameworks you can use Java's regular expressions for parsing the text:

    http://developer.android.com/reference/java/util/regex/Pattern.html

    If you want named regexps you can consider

    https://code.google.com/p/named-regexp/

    If you want more complex parsing with semantics and intent extraction which goes beyond automata capabilities, you can find corresponding packages in opennlp

    If you want to recognize grammars, you can try CMUSphinx, it's significantly more accurate on constrained recognition.