<commit_before>/*
 * Description:
 *   Gives an Urban Dictionary definition for a given word.
 *
 * Commands:
 *   hubot what('s| is) <word>    = <details> - top result from the results list. Repeated requests cycle through the list
 *   hubot what('s | is) a <word> = <details> - a random result from the list
 */

const axios = require('axios')
const sample = require('lodash/sample')
const remove = require('lodash/remove')
const bindAll = require('lodash/bindAll')

axios.defaults.baseURL = 'http://api.urbandictionary.com/v0'

let UrbanDict = {
  searchTerm: '',
  prevSearchTerm: '',
  results: [],
  shouldRandomiseResult: false,

  init(res, shouldRandomiseResult) {
    this.res = res
    if (!this.res) {
      throw new Error('robot response is required')
    }<commit_msg>Revert to previous doc comment style to avoid console warnings<commit_after>// Description:
//   Gives an Urban Dictionary definition for a given word.
//
// Commands:
//   hubot what('s| is) <word>    = <details> - top result from the results list. Repeated requests cycle through the list
//   hubot what('s | is) a <word> = <details> - a random result from the list

const axios = require('axios')
const sample = require('lodash/sample')
const remove = require('lodash/remove')
const bindAll = require('lodash/bindAll')

axios.defaults.baseURL = 'http://api.urbandictionary.com/v0'

let UrbanDict = {
  searchTerm: '',
  prevSearchTerm: '',
  results: [],
  shouldRandomiseResult: false,

  init(res, shouldRandomiseResult) {
    this.res = res
    if (!this.res) {
      throw new Error('robot response is required')
    }
{'fraction_non_alphanumeric': 0.12919254658385093, 'fraction_numerical': 0.0012422360248447205, 'mean_word_length': 3.724340175953079, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '840223', 'n_tokens_mistral': 502, 'n_tokens_neox': 492, 'n_words': 157}