<commit_before>// Module for translation
// dependencies
var _ = require('lomath')

// // Development process, testing after starting server with "npm run server"
// var client = require('../lib/client.js')
// global.gPass = client.gPass

// global.gPass({
//   input: "<NAME>",
//   to: 'ai.py',
//   intent: 'nlp.translate'
// }).then(console.log)
// // hello friends


// deploy feature: export for bot
module.exports = function(robot) {
  // menu
  robot.respond(/translate\s*$/i, function(res) {
    res.send('`translate <text>`')
  })

  // translate
  /* istanbul ignore next */
  robot.respond(/translate\s*(.+)/i, function(res) {
    var str = res.match[1];
    global.gPass({
      input: str,
      to: 'nlp.py',
      intent: 'translate'
    })
    .then(function(reply) {
      res.send(reply.output)
    })
  })

}<commit_msg>fix translate.js example<commit_after>// Module for translation
// dependencies
var _ = require('lomath')

// // Development process, testing after starting server with "npm run server"
// var client = require('../lib/client.js')
// global.gPass = client.gPass

// global.gPass({
//   input: "<NAME>",
//   to: 'nlp.py',
//   intent: 'translate'
// }).then(console.log)
// // hello friends


// deploy feature: export for bot
module.exports = function(robot) {
  // menu
  robot.respond(/translate\s*$/i, function(res) {
    res.send('`translate <text>`')
  })

  // translate
  /* istanbul ignore next */
  robot.respond(/translate\s*(.+)/i, function(res) {
    var str = res.match[1];
    global.gPass({
      input: str,
      to: 'nlp.py',
      intent: 'translate'
    })
    .then(function(reply) {
      res.send(reply.output)
    })
  })

}
{'fraction_non_alphanumeric': 0.1895734597156398, 'fraction_numerical': 0.001184834123222749, 'mean_word_length': 2.647948164146868, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7208279', 'n_tokens_mistral': 577, 'n_tokens_neox': 565, 'n_words': 126}