Him Am 02.12.2012 um 16:03 schrieb subhabangal...@gmail.com: > I have a list of the following pattern, > > [("''", "''"), ('Eastern', 'NNP'), ('Army', 'NNP'), ('Commander', 'NNP'), > ('Lt', 'NNP'), ('Gen', 'NNP'), ('Dalbir', 'NNP'), ('Singh', 'NNP'), ('Suhag', > 'NNP'), ('briefed', 'VBD'), ('the', 'DT'), ('Army', 'NNP'), ('chief', 'NN'), > ('on', 'IN'), ('the', 'DT'), ('operational', 'JJ'), ('preparedness', 'NN'), > ('and', 'CC'), ('the', 'DT'), ('security', 'NN'), ('scenario', 'NN'), ('in', > 'IN'), ('the', 'DT'), ('eastern', 'NN'), ('region', 'NN'), (',', ','), ("''", > "''"), ('defence', 'NN'), ('spokesperson', 'NN'), ('Group', 'NNP'), ('Capt', > 'NNP'), ('T', 'NNP'), ('K', 'NNP'), ('Singha', 'NNP'), ('said', 'VBD'), > ('here', 'RB')] > > Now, as we see it has multiple VBD elements. > I want to recognize,count and index them all.
len([x for x in l if x[1] == 'VBD']) Lutz -- This email is signed with a CAcert certificate. https://www.cacert.org/ Please do not send me Microsoft Office/Apple iWork documents. Send OpenDocument instead! http://fsf.org/campaigns/opendocument/ https://duckduckgo.com/ | http://donttrack.us/ | http://dontbubble.us/
smime.p7s
Description: S/MIME cryptographic signature
-- http://mail.python.org/mailman/listinfo/python-list