![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)
machine-translator
is a nodejs module that uses statistical machine translation to translate between two different languages. the module is loosely based off of the IBM model 1 algorithm and has been tested using english.
Install:
$ npm install machine-translator
Usage:
This module requires:
- A native corpus of text (i.e. english text file)
- A matching foreign corpus of text (i.e. german text file)
Example
var Translator = require('machine-translator');
var t = new Translator();
t.train('./tests/data/shortEN.txt', './tests/data/shortDE.txt');
t.translate('cat');
t.translate('the');
t.translate('car');
NPM Commands
We have some NPM commands to help testing/linting:
npm run test:watch
npm run lint
npm run lint:watch
# lint in watch mode
npm run compile
# important!! needs to be run before release, note how main script points to dist instead of src
License:
MIT License 2015-2018 © Andy Craze & Contributors