Skip to content

Commit

Permalink
en dict + word bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wasnoplus committed Sep 28, 2020
1 parent c9ac485 commit 5f1fd22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion script/redEn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const langModel = "model-en.tar.gz";

const next = ["next", 'mixed'];
const prev = ["back", "bag", "beck", "previous", "preview"];
const prev = ["back", "bag", "beg", "beck", "previous", "preview", "peck"];
14 changes: 1 addition & 13 deletions script/resultHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,18 @@ 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;
}


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
}
});
Expand All @@ -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);
}
Expand Down

0 comments on commit 5f1fd22

Please sign in to comment.