Programatically submit files to lmtool and get the files back
It submits a corpus file for you, to the service lmtool. This service will give you a dictionary and vocabulary back, to be used for speech to text tools.
npm i -S lmtool
Start a new lmtool submission with the words specified.
words
. Required. An array of words to use for your corpus file.callback(err, fileName)
. Required. A callback to call with the name prefix of your dictionary and vocabulary files.
An array of words you want to use.
const lmtool = require('lmtool');
lmtool(['lazer', 'exterminate', 'cuddle'], (err, fileName) => {
// fileName will now be something like 1337, and that will represent the
// prefix for the extracted files you have gotten downloaded. Or, of course,
// if there was an error, fileName will be empty and err will contain the
// information about the error.
console.log(require('fs').readFileSync('1337.dic').toString());
// Will output something like:
// CUDDLE K AH D AH L
// EXTERMINATE IH K S T ER M AH N EY T
// LAZER L EY Z ER
});