mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
lets flip it around. 0 bad 100 good in pocketsphinx now. Scoring in the lib was changed so I had to do this change
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9194 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -181,43 +181,26 @@ function SpeechDetect(session, mod, ip) {
|
||||
console_log("debug", "----Hit score " + interp.@score + "/" + grammar_object.min_score + "/" + grammar_object.confirm_score + "\n");
|
||||
}
|
||||
|
||||
if (_this.mod == "pocketsphinx") {
|
||||
/* pocketsphinx scores 0 best to 100 worst. */
|
||||
if (interp.@score >= grammar_object.min_score) {
|
||||
if (interp.@score >= grammar_object.confirm_score) {
|
||||
rv.push("_confirm_");
|
||||
}
|
||||
if (interp.@score >= grammar_object.min_score) {
|
||||
if (interp.@score < grammar_object.confirm_score) {
|
||||
rv.push("_confirm_");
|
||||
}
|
||||
|
||||
eval("xo = interp." + grammar_object.obj_path + ";");
|
||||
for (x = 0; x < xo.length(); x++) {
|
||||
rv.push(xo[x]);
|
||||
console_log("info", "----" +xo[x] + "\n");
|
||||
}
|
||||
} else {
|
||||
rv.push("_no_idea_");
|
||||
eval("xo = interp." + grammar_object.obj_path + ";");
|
||||
for (x = 0; x < xo.length(); x++) {
|
||||
rv.push(xo[x]);
|
||||
console_log("info", "----" +xo[x] + "\n");
|
||||
}
|
||||
} else {
|
||||
if (interp.@score >= grammar_object.min_score) {
|
||||
if (interp.@score < grammar_object.confirm_score) {
|
||||
rv.push("_confirm_");
|
||||
}
|
||||
|
||||
eval("xo = interp." + grammar_object.obj_path + ";");
|
||||
for (x = 0; x < xo.length(); x++) {
|
||||
rv.push(xo[x]);
|
||||
console_log("info", "----" +xo[x] + "\n");
|
||||
}
|
||||
} else {
|
||||
rv.push("_no_idea_");
|
||||
}
|
||||
rv.push("_no_idea_");
|
||||
}
|
||||
|
||||
delete interp;
|
||||
return rv;
|
||||
}
|
||||
delete interp;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Constructor for SpeechObtainer Class (Class to collect data from a SpeechDetect Class) */
|
||||
function SpeechObtainer(asr, req, wait_time) {
|
||||
|
Reference in New Issue
Block a user