title: Counting the Frequency of Specific Words in Text File
body: <p>I have a text file stored as a string variable. The text file is processed so that it only contains lowercase words and spaces. Now, say I have a static dictionary, which is just a list of specific words, and I want to count, from within the text file, the frequency of each word in the dictionary. For example:</p>
  
  <pre><code>Text file:
  
  i love love vb development although i m a total newbie
  
  Dictionary:
  
  love, development, fire, stone
  </code></pre>
  
  <p>The output I'd like to see is something like the following, listing both the dictionary word and its count. If it makes coding simpler, it can also only list the dictionary word that appeared in the text. </p>
  
  <pre><code>===========
  
  WORD, COUNT
  
  love, 2
  
  development, 1
  
  fire, 0
  
  stone, 0
  
  ============
  </code></pre>
  
  <p>Using a regex (eg "\w+") I can get all the word matches, but I have no clue how to get the counts that are also in the dictionary, so I'm stuck. Efficiency is crucial here since the dictionary is quite large (~100,000 words) and the text files are not small either (~200kb each). </p>
  
  <p>I appreciate any kind help. </p>