#!/usr/bin/env node
'use strict';

var _asdfjkl = require('./asdfjkl');

var _asdfjkl2 = _interopRequireDefault(_asdfjkl);

var _commander = require('commander');

var _commander2 = _interopRequireDefault(_commander);

var _package = require('../package.json');

var _package2 = _interopRequireDefault(_package);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

_commander2.default.version(_package2.default.version).option('-T, --train [fileName]', 'Train the model with your own file').option('-t, --try <text>', 'Text to try Asdfjkl').parse(process.argv);

if (!_commander2.default.train && !_commander2.default.try) _commander2.default.help();

if (_commander2.default.train) {
  var flagOrFileName = _commander2.default.train;
  flagOrFileName === true ? (0, _asdfjkl.train)() : (0, _asdfjkl.train)(flagOrFileName);
}

if (_commander2.default.try) {
  var text = _commander2.default.try;
  var result = (0, _asdfjkl2.default)(text);
  console.log('Result for "' + text + '": ' + result);
}