2016-09-15 7 views
1

私の名前はmasoudです。 今私はmasoudと言うとき、私のアプリはコンソールログを出力したいと思う。これを行うには電話機 'MA'が音響モデルでマイニングしています。単語 'masoud' - pocketsphinx

私はmdic.txtファイルを作って、私はその中に私の名前を入れて:

マソウドMA S O D

私はmdic.dictmdic.txtを変更し、assets/sync direcotryでそれを置きます。

私はcm.txtファイルを作って、私はその中に文字列を置く:

#JSGF V1.0; 
/** 
* JSGF Grammar for Hello World example 
*/ 
grammar masoud; 
public <greet> = (good morning | masoud) (bhiksha | evandro | paul | philip | rita | will); 

と私はcm.gramcm.txtを変更しました。私はこのメッセージを得た今

private void setupRecognizer(File assetsDir) throws IOException { 
    // The recognizer can be configured to perform multiple searches 
    // of different kind and switch between them 

    recognizer = SpeechRecognizerSetup.defaultSetup() 
      .setAcousticModel(new File(assetsDir, "en-us-ptm")) 
      //.setDictionary(new File(assetsDir, "cmudict-en-us.dict")) 
      .setDictionary(new File(assetsDir, "mdic.dict")) 
      //.setRawLogDir(assetsDir) // To disable logging of raw audio comment out this call (takes a lot of space on the device) 
      .setKeywordThreshold(1e-45f) // Threshold to tune for keyphrase to balance between false alarms and misses 
      .setBoolean("-allphone_ci", true) // Use context-independent phonetic search, context-dependent is too slow for mobile 


      .getRecognizer(); 
    recognizer.addListener(this); 

    /** In your application you might not need to add all those searches. 
    * They are added here for demonstration. You can leave just one. 
    */ 

    // Create keyword-activation search. 
    //recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE); 

    recognizer.addKeywordSearch(KWS_SEARCH, new File(assetsDir, "mdic.dict")); 

私MainActivityで

"dict.c" を、行195:1行目:電話 'MA' は音響 モデルにmisingされます。単語「kws_search.c」無視「マソウド」、行171:単語 「マソウド」辞書

に欠けている私はrecognizer.addKeywordSearch(KWS_SEARCH, new File(assetsDir, "mdic.dict"));ラインで、このエラーを得ました。

+0

masoudの正しい転記は「M AH S UW D」 –

答えて

1

masoudの正しい転記は「M AH S UW D」です。

音響モデルに電話機MAはありません。そのエラーはそれについて言います。

+0

単語の正しい転記を知る方法ですか? –

+0

http://cmusphinx.sourceforge.net/wiki/tutorialdict –

関連する問題