2.0.3 • Published 9 years ago

lmtool v2.0.3

Weekly downloads
15
License
MIT
Repository
github
Last release
9 years ago

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

});