Menu

Get matched grammar

ysertz
2016-04-13
2017-06-18
  • ysertz

    ysertz - 2016-04-13

    Hi,

    after receiving speech input, can I get the rule of the grammar that it matched? For example, I have two rules:

    <hello> = hello | hi | hey
    <bye> = [ good ] bye
    public

    = <hello> | <bye></bye></hello></bye></hello>

    Can I now somehow get the name of the rule ("<hello>" for "hi")? I'm currently using the OpenNLP classifier to classify the input, but I guess I'd get better results with less work if I could just somehow get the rule name.</hello>

    Thanks!

     
    • Nickolay V. Shmyrev

      after receiving speech input, can I get the rule of the grammar that it matched?

      No

      Can I now somehow get the name of the rule ("<hello>" for "hi")? I'm currently using the OpenNLP classifier to classify the input, but I guess I'd get better results with less work if I could just somehow get the rule name.</hello>

      You can write a regular expression to parse the output

      Additional discussion here:

      https://github.com/cmusphinx/pocketsphinx/issues/13

       

Log in to post a comment.

MongoDB Logo MongoDB