java - Setting treshhold in grammar-file of PocketSphinx keyword detection -


i`m trying author of thread did/solved:

recognizing multiple keywords using pocketsphinx

he says grammar-file should avoid detection of words not in grammar-file:

up /1e-1/ down /1e-1/ left /1e-1/ right /1e-1/ forwards /1e-1/ backwards /1e-1/ 

....but doesnt work if this. can this:

#jsgf v1.0; grammar digits; public <digits> =   /1e-1/ left |                     /1e-1/ right; 

but doesnt change anything, neither /1.0/ change anything. keeps detecting false words left/right.

putting threshold on right side of each word (like author) leads app-crashing.

can me on this?

update:

i solved it, using addkeywordsearch in function setuprecognizer(file assetsdir). still in pocketsphinx-demo addgrammarsearch in case. completeness (just setuprecognizer function of author of linked question):

private void setuprecognizer(file assetsdir) {     file modelsdir = new file(assetsdir, "models");      recognizer = defaultsetup().setacousticmodel(new file(modelsdir, "hmm/en-us-semi"))                                .setdictionary(new file(modelsdir, "dict/cmu07a.dic"))                                .setrawlogdir(assetsdir).setkeywordthreshold(1e-20f)                                .getrecognizer();      recognizer.addlistener(this);      file digitsgrammar = new file(modelsdir, "grammar/digits.gram");     recognizer.addkeywordsearch(digits_search, digitsgrammar); } 

it works if grammar file looks (also author posted) exactly this:

up /1e-1/ down /1e-1/ left /1e-1/ right /1e-1/ forwards /1e-1/ backwards /1e-1/ 


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -