<commit_before>const emojis = require('./emojis')

const isWordEscaped = word => {
  const firstChar = word.charAt(0)
  const lastChar = word.slice(-1)

  return firstChar === ':' && lastChar === ':'
}

const getEmoji = word => {
  const trimmedWord = word.slice(1, word.length - 1)

  return emojis[trimmedWord] || word
}

const emojify = text => {
  const words = text.split(' ')
  const numOfWords = words.length
  let emoji = ''
  let currentWord = ''

  for (let i = 0; i < numOfWords; i++) {
    currentWord = words[i]

    if (isWordEscaped(currentWord)) {
      emoji = getEmoji(currentWord)
      words[i] = emoji
    }
  }

  const sentance = words.join(' ')

  return sentance
}

module.exports = emojify<commit_msg>refactor: remove unneeded variables<commit_after>const emojis = require('./emojis')

const isWordEscaped = word => {
  const firstChar = word.charAt(0)
  const lastChar = word.slice(-1)

  return firstChar === ':' && lastChar === ':'
}

const getEmoji = word => {
  const trimmedWord = word.slice(1, word.length - 1)

  return emojis[trimmedWord] || word
}

const emojify = text => {
  const words = text.split(' ')
  const numOfWords = words.length

  for (let i = 0; i < numOfWords; i++) {
    const currentWord = words[i]

    if (isWordEscaped(currentWord)) {
      words[i] = getEmoji(currentWord)
    }
  }

  return words.join(' ')
}

module.exports = emojify
{'fraction_non_alphanumeric': 0.14716439339554918, 'fraction_numerical': 0.007178750897343862, 'mean_word_length': 3.289230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1946445', 'n_tokens_mistral': 509, 'n_tokens_neox': 488, 'n_words': 116}