def word_number(string)
  answer = []
  answer_array = []
  splitString = string.split(/ /)

  splitString.map do |word|
  word.gsub!(/[^0-9A-Za-z]/, "")
  word.downcase!
  end

  idx1 = 0
  while idx1 < splitString.length
  word = splitString[idx1]
  count = 0
  idx2 = 0

    while idx2 < splitString.length
    if splitString[idx2] == word
    count += 1
    end
    idx2 += 1
    end

    answer_array = [word, count]

    if answer.flatten.include?(word)
      nil
    else
      answer.push(answer_array)
    end

    idx1 += 1

  end
  return answer
end
