old_contents: from collections import Counter
  
  
  def word_count(text):
      def replace_nonalpha(char):
          return char.lower() if char.isalnum() else ' '
      text = ''.join(replace_nonalpha(c) for c in text)
      return Counter(text.split())
  
new_contents: import re
  
  from collections import Counter
  
  
  WORDS = re.compile("[a-z0-9]+(['][a-z]+)?")
  
  
  def word_count(text):
      return Counter(word.group(0) for word in WORDS.finditer(text.lower()))
  
subject: Update example to work with new tests (#1059)