From 5f1fd2281731165196b454d7aa0392c337895b9c Mon Sep 17 00:00:00 2001 From: Benjamin Ver Date: Mon, 28 Sep 2020 15:36:09 +0200 Subject: [PATCH] en dict + word bug --- script/redEn.js | 2 +- script/resultHandling.js | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/script/redEn.js b/script/redEn.js index 22d363a..ab558ad 100644 --- a/script/redEn.js +++ b/script/redEn.js @@ -1,4 +1,4 @@ const langModel = "model-en.tar.gz"; const next = ["next", 'mixed']; -const prev = ["back", "bag", "beck", "previous", "preview"]; \ No newline at end of file +const prev = ["back", "bag", "beg", "beck", "previous", "preview", "peck"]; \ No newline at end of file diff --git a/script/resultHandling.js b/script/resultHandling.js index b099a95..17874aa 100644 --- a/script/resultHandling.js +++ b/script/resultHandling.js @@ -31,15 +31,6 @@ function handleResult(res, handleIt, reset=null) { if (typeof reset === 'function') { reset(); } - // var wordHandled = false; - // res.result.forEach((x) => { - // console.log(x.word) - // if (allWords.includes(x.word)) { - // wordHandled = true; - // wait = true - // handleIt(x.word, x.conf); - // } - // }); wait = false; } @@ -47,13 +38,11 @@ function handleResult(res, handleIt, reset=null) { function handlePartial(res, handleIt) { var wordHandled = false; partialBuffer = res.partial; - // console.log(partialBuffer); res.partial.split(' ').forEach((x) => { - // console.log(x); //// if (allWords.includes(x)) { wordHandled = true; wait = true - handleIt(x.word, 1); + handleIt(x); return wordHandled } }); @@ -76,7 +65,6 @@ thisRec = new VoskJS.Recognizer(langModel); thisRec.onresult = (result) => { if (!wait && result.partial) { - // console.log("=P= " + result.partial) if (result.partial != partialBuffer) { handlePartial(result, sendCommand); }