I\'ve got a list of Tokens which looks something like:
[{ Value: \"Blah\", StartOffset: 0, EndOffset: 4 }, ... ]
What I want to do
import collections # example token list tokens = [{'Value':'Blah', 'Start':0}, {'Value':'BlahBlah'}] count=collections.Counter([d['Value'] for d in tokens]) print count
shows
Counter({'BlahBlah': 1, 'Blah': 1})