title: Count occurences of strings in a text file
body: <p>I have the following program and I want to find for example the string 'light pink' in my text file!
  I use <code>word==' '.join(['light','pink'])</code> and it doesn't works.</p>
  
  <pre><code>from operator import itemgetter
  
  def mmetric1(file):
      words_gen = (word.lower() for line in open("test.txt")
                                               for word in line.split())
      words = {}
  
      for word in words_gen:
          if (word=='aqua')or(word=='azure')or(word=='black')or(word=='light pink'):
              words[word] = words.get(word, 0) + 1
  
      top_words = sorted(words.items(), key=itemgetter(1))
  
      for word, frequency in top_words:
         print ("%s : %d" % (word, frequency))
  </code></pre>