diff --git a/script/redEn.js b/script/redEn.js new file mode 100644 index 0000000..6cc882c --- /dev/null +++ b/script/redEn.js @@ -0,0 +1,4 @@ +const langModel = "model-en.tar.gz"; + +const next = ["next"]; +const prev = ["back", "bag", "beck", "previous", "preview"]; \ No newline at end of file diff --git a/script/redNl.js b/script/redNl.js new file mode 100644 index 0000000..27cdf29 --- /dev/null +++ b/script/redNl.js @@ -0,0 +1,4 @@ +const langModel = "model-nl.tar.gz"; + +const next = ["volgende", "volgend", "vervolgend", "volgen", "volg"]; +const prev = ["vorige", "vorig"]; \ No newline at end of file diff --git a/script/resultHandling.js b/script/resultHandling.js index 73ffea8..550ce85 100644 --- a/script/resultHandling.js +++ b/script/resultHandling.js @@ -1,12 +1,21 @@ // todo script/VoskJS.js inladen -const langModel = "model-nl.tar.gz"; -const allWords = ['volgende', 'vorige']; +// const langModel = "model-nl.tar.gz"; +// const allWords = ['volgende', 'vorige']; const callbacks = []; -const eventWordMap = { - 'vorige': 'navigate-backward', - 'volgende': 'navigate-forward', -}; +const allWords = [] +var eventWordMap; + +function addToCommands (words, command) { + words.forEach(function(w) { + eventWordMap[w] = command; + allWords.push(w); + }) +} + +addToCommands(next, 'navigate-forward'); +addToCommands(prev, 'navigate-backward'); + window.iridium = {}; window.iridium.onExternalNavigate = (callback) => {