Skip to content

Programatically submit files to lmtool and get the files back

License

Notifications You must be signed in to change notification settings

eiriksm/node-lmtool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-lmtool

Programatically submit files to lmtool and get the files back

Build Status Coverage Status Code Climate Dependency Status

What does it do?

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.

Installation

npm i -S lmtool

API

lmtool(words, callback)

Start a new lmtool submission with the words specified.

Arguments

  • 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.

Example

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

});

About

Programatically submit files to lmtool and get the files back

Resources

License

Stars

Watchers

Forks

Packages

No packages published