<commit_before>const AlchemyLanguageV1 = require('watson-developer-cloud/alchemy-language/v1')

if (!process.env.ALCHEMY_API_KEY) {
  throw new Error('ALCHEMY_API_KEY must be set.')
}

// see https://github.com/watson-developer-cloud/node-sdk#alchemylanguage
const alchemyLanguage = new AlchemyLanguageV1({
  api_key: process.env.ALCHEMY_API_KEY
})

var params = {
  text: process.argv.slice(2).join(' ')
}

console.log('Getting sentiment for "%s".', params.text)
alchemyLanguage.sentiment(params, function (error, result) {
  if (error) {
    console.log(error)
    return
  }

  console.log(JSON.stringify(result, null, 2))
})<commit_msg>fix(script): pass language param to alchemy analysis<commit_after>const AlchemyLanguageV1 = require('watson-developer-cloud/alchemy-language/v1')

if (!process.env.ALCHEMY_API_KEY) {
  throw new Error('ALCHEMY_API_KEY must be set.')
}

// see https://github.com/watson-developer-cloud/node-sdk#alchemylanguage
const alchemyLanguage = new AlchemyLanguageV1({
  api_key: process.env.ALCHEMY_API_KEY
})

var params = {
  text: process.argv.slice(2).join(' '),
  language: 'english'
}

console.log('Getting sentiment for "%s".', params.text)
alchemyLanguage.sentiment(params, function (error, result) {
  if (error) {
    console.log(error)
    return
  }

  console.log(JSON.stringify(result, null, 2))
})
{'fraction_non_alphanumeric': 0.14381520119225039, 'fraction_numerical': 0.007451564828614009, 'mean_word_length': 4.9688888888888885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '204410', 'n_tokens_mistral': 495, 'n_tokens_neox': 459, 'n_words': 86}