Wrong results from frequency counting
<p>I am trying to find the occurences of one list of words in another list of words.
My code looks like this:</p>

<pre><code>for cat, text2 in posts:
words=wordpunct_tokenize(text2)
for word in words:
    if word in top:
        counter[word]+=1

print counter
</code></pre>

<p>Words looks like this: <code>[("Post1", "post1" ,"post1"), ("post2","post2), ("post3")]</code>
top looks like this <code>"Post1, Post2, Post3"</code>
An expected result would be:</p>

<pre><code>{post1: 3}
{post2, 2}
{post3, 1}
</code></pre>

<p>however the output I now get is:</p>

<pre><code>{'post1': 3})
{'post2': 2, 'post1': 3})
{'post3': 1, 'post2': 2, 'post1': 3})
</code></pre>

<p>It looks like the program adds the words from the previous line to the next one, anyone know how I can fix this?</p>
