<commit_before>const axios = require('axios');


module.exports = (docomoToken) => {
  const api = require('./api.js')(docomoToken)

  const weather = require('../weather/api.js')

  return {
    guessIntent: (text, user, onReply) => {
      api.understanding(text, user)
        .then(intent => {
          switch (intent.command.commandName) {
            case '天気':
              const location = intent.slotStatus.find(s => s.slotName == 'searchArea').slotValue
              const date = intent.slotStatus.find(s => s.slotName == 'date').slotValue
              weather.ask(location, date)
                .then(text => onReply(text))
                .catch(error => api.conversation(text, context, onReply))
              break
            default:
              api.conversation(text, context, user)
                .then(text => onReply(text))
                .catch(error => onReply('故障中！故障中！'))
              break
          }
        })
    }
  }
}<commit_msg>fix undefined variables<commit_after>const axios = require('axios');


module.exports = (docomoToken) => {
  const api = require('./api.js')(docomoToken)

  const weather = require('../weather/api.js')

  return {
    guessIntent: (text, user, onReply) => {
      api.understanding(text, user)
        .then(intent => {
          switch (intent.command.commandName) {
            case '天気':
              const location = intent.slotStatus.find(s => s.slotName == 'searchArea').slotValue
              const date = intent.slotStatus.find(s => s.slotName == 'date').slotValue
              weather.ask(location, date)
                .then(text => onReply(text))
                .catch(error => onReply('故障中！故障中！'))
              break
            default:
              api.conversation(text, user)
                .then(text => onReply(text))
                .catch(error => onReply('故障中！故障中！'))
              break
          }
        })
    }
  }
}
{'fraction_non_alphanumeric': 0.14464099895941726, 'fraction_numerical': 0.0, 'mean_word_length': 1.8404726735598227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3581592', 'n_tokens_mistral': 579, 'n_tokens_neox': 563, 'n_words': 101}