私の名前はmasoud
です。 今私はmasoud
と言うとき、私のアプリはコンソールログを出力したいと思う。これを行うには電話機 'MA'が音響モデルでマイニングしています。単語 'masoud' - pocketsphinx
私はmdic.txt
ファイルを作って、私はその中に私の名前を入れて:
マソウドMA S O D
私はmdic.dict
にmdic.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.gram
にcm.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"));
ラインで、このエラーを得ました。
masoudの正しい転記は「M AH S UW D」 –