title: Exception when word is missing in the dictionary
body: <p>I tried the demo app, it works fine but when I tried to integrate my own .jsgf grammar file it is giving error when I tried same thing using .lm file for the same dictionary it is working fine . </p>
  
  <p>I referred to <a href="https://stackoverflow.com/questions/25738001/pocketsphinx-android-demo-runtime-exception">PocketSphinx android demo runtime exception</a> link but it didn't help me out</p>
  
  <p>Following is the code snippet:</p>
  
  <pre><code>private void setupRecognizer(File assetsDir) throws IOException {
          // The recognizer can be configured to perform multiple searches
          // of different kind and switch between them
          File modelsDir = new File(assetsDir, "models");
          mRecognizer = defaultSetup()
                  .setAcousticModel(new File(assetsDir, "en-us-ptm"))
                  .setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
                  .setRawLogDir(assetsDir)
                  .setKeywordThreshold(1e-10f)
                  .setFloat("-beam", 1e-30f)
                  .setBoolean("-allphone_ci", true)
                  .getRecognizer();
          mRecognizer.addListener(this);
          File languageModel = new File(assetsDir, "commands_gram.gram");
          mRecognizer.addGrammarSearch(COMMANDS, languageModel);
      }
  </code></pre>
  
  <p>Following is the error</p>
  
  <pre><code>E/cmusphinx: ERROR: "fsg_search.c", line 141: The word 'next' is missing in the dictionary
  E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
  
  Process: java.lang.RuntimeException: An error occured while executing doInBackground()
  at android.os.AsyncTask$3.done(AsyncTask.java:300)
  at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
  at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
  at java.util.concurrent.FutureTask.run(FutureTask.java:242)
  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:818) 
  Caused by: java.lang.RuntimeException: Decoder_setJsgfFile returned -1
  at edu.cmu.pocketsphinx.PocketSphinxJNI.Decoder_setJsgfFile(Native Method)
  at edu.cmu.pocketsphinx.Decoder.setJsgfFile(Decoder.java:139)
  at edu.cmu.pocketsphinx.SpeechRecognizer.addGrammarSearch(SpeechRecognizer.java:234)
  at com.package.ui.SphinxSpeechRecognizerActivity.setupRecognizer(SphinxSpeechRecognizerActivity.java:284)
  at com.package.ui.SphinxSpeechRecognizerActivity.access$400(SphinxSpeechRecognizerActivity.java:29)
  at com.package.ui.SphinxSpeechRecognizerActivity$3.doInBackground(SphinxSpeechRecognizerActivity.java:239)
  at com.package.ui.SphinxSpeechRecognizerActivity$3.doInBackground(SphinxSpeechRecognizerActivity.java:233)
  at android.os.AsyncTask$2.call(AsyncTask.java:288)
  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:818) 
  </code></pre>
  
  <p>Also I realized that any .jsgf grammar file I am using it is not detecting the last word from the dictionary. before it was working fine after I changed to my own .jsgf grammar file it is giving exception</p>