Android 安卓Pocketspinx“;字典中缺少单词%s“;错误
我正在尝试使用这个pocket sphinx android库测试片段中的一些基本关键字识别。我已经设置了项目jar并将其正确添加为依赖项,我已经按照本教程中的说明将.so文件添加到jniLibs文件夹中 就其他搜索(数字等)而言,一切似乎都很好…但由于某些原因,我无法让关键字搜索正常工作。我得到了一个非常清晰和明确的错误信息崩溃。这基本上是说字典里找不到一大堆单词Android 安卓Pocketspinx“;字典中缺少单词%s“;错误,android,speech-recognition,pocketsphinx-android,pocketsphinx,Android,Speech Recognition,Pocketsphinx Android,Pocketsphinx,我正在尝试使用这个pocket sphinx android库测试片段中的一些基本关键字识别。我已经设置了项目jar并将其正确添加为依赖项,我已经按照本教程中的说明将.so文件添加到jniLibs文件夹中 就其他搜索(数字等)而言,一切似乎都很好…但由于某些原因,我无法让关键字搜索正常工作。我得到了一个非常清晰和明确的错误信息崩溃。这基本上是说字典里找不到一大堆单词 04-19 14:35:59.930 6107/? E/cmusphinx﹕ ERROR: "kws_search.c",
04-19 14:35:59.930 6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'EH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'SH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'SH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'SH' is missing in the dictionary
我正在使用随库附带的字典“cmu en us.dict”,实际上它似乎根本没有包含这些大写单词
于是我四处寻找,找到了这个
当我将其添加到项目中,并尝试引用该词典时。我犯了和以前一样的错误,但现在说我正在使用的上一本词典(cmu en us.dict)中的单词不见了
我不确定我做错了什么。但我只是遵循了设置教程,并在这里使用了演示项目活动中的代码
哦,下面是我如何设置语音识别器的
private void setupRecognizer(File assetsDir) throws IOException {
// The recognizer can be configured to perform multiple searches
// of different kind and switch between them
Log.d("RecipeSearchFragment", "setupRecognizer");
mRecognizer = defaultSetup()
.setAcousticModel(new File(assetsDir, "en-us-ptm"))
.setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
// To disable logging of raw audio comment out this call (takes a lot of space on the device)
.setRawLogDir(assetsDir)
// Threshold to tune for keyphrase to balance between false alarms and misses
.setKeywordThreshold(1e-45f)
// Use context-independent phonetic search, context-dependent is too slow for mobile
.setBoolean("-allphone_ci", true)
.getRecognizer();
mRecognizer.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.
*/
mRecognizer.addKeywordSearch(KWS_SEARCH, new File(assetsDir, "cmudict-en-us.dict"));
mRecognizer.startListening(KWS_SEARCH);
}
还有人碰到过这个吗?我做错了什么?关键字搜索配置了一个关键字列表文件。关键字短语列表文件每行列出一个关键字短语: 您在以下行中错误地将字典用作关键字列表文件:
mRecognizer.addKeywordSearch(KWS_SEARCH, new File(assetsDir, "cmudict-en-us.dict"));
这不是个好主意。谢谢你的评论!我觉得我做错了什么。所以基本上,我必须用一组预定义的单词来配置我自己的关键字列表文件?我认为这个库可以用来识别像“蛋”或“鸟”这样的动态单词。至少在我的用例中,我无法知道用户会提前说什么词。我可以用pocket sphinx来完成这个任务吗?对我来说,我传递的是小写字母“ok”,所以它也区分大小写