title: String manipulation using lower() and str.translate not changing string - Python 3.7.0
body: <p>I am trying to remove punctuation and lowercase a long string (taken from a text file).</p>
  
  <p>I have an example text file, like so:</p>
  
  <pre><code>This. this, Is, is. An; an, Example. example! Sentence? sentence.
  </code></pre>
  
  <p>I then have the following script:</p>
  
  <pre><code>def get_input(filepath):
      f = open(filepath, 'r')
      content = f.read()
      return content
  
  def normalize_text(file):
      all_words = word_tokenize(file)
      for word in all_words:
          word = word.lower()
          word = word.translate(str.maketrans('','',string.punctuation))
  
      return all_words
  
  def get_collection_size(mydict):
      total = sum(mydict.values())
      return total
  
  def get_vocabulary_size(mylist):
      unique_list = numpy.unique(mylist)
      vocabulary_size = len(unique_list)
      return vocabulary_size
  
  myfile = get_input('D:\\PythonHelp\\example.txt')
  
  total_words = normalize_text(myfile)
  mydict = countElement(total_words)
  print(total_words)
  print(mydict)
  print("Collection Size: {}".format(get_collection_size(mydict)))
  print("Vocabulary Size: {}".format(get_vocabulary_size(total_words)))
  </code></pre>
  
  <p>And I get results like the following:</p>
  
  <pre><code>['This', '.', 'this', ',', 'Is', ',', 'is', '.', 'An', ';', 'an', ',', 'Example', '.', 'example', '!', 'Sentence', '?', 'sentence', '.']
  {'This': 1, '.': 4, 'this': 1, ',': 3, 'Is': 1, 'is': 1, 'An': 1, ';': 1, 'an': 1, 'Example': 1, 'example': 1, '!': 1, 'Sentence': 1, '?': 1,
  'sentence': 1}
  Collection Size: 20
  Vocabulary Size: 15
  </code></pre>
  
  <p>However, I would be expecting:</p>
  
  <pre><code>['this', 'is', 'an', 'example', 'sentence']
  {'this:' 2, 'is:' 2, 'an:' 2, 'example:' 2, 'sentence:' 2}
  Collection Size: 10
  Vocabulary Size: 5
  </code></pre>
  
  <p>Why is the <code>def normalize_text(file):</code> that uses <code>str.maketrans</code> and <code>.lower()</code> not working properly?</p>
  
  <p>When I run <code>python --version</code> I get <code>3.7.0</code></p>