is it possible to do the following code with python:
import nltk
from nltk.corpus.reader import TaggedCorpusReader
reader = TaggedCorpusReader('cookbook', r'.*\.pos')
train_sents=reader.tagged_sents()
tags=[]
count=0
for sent in train_sents:
for (word,tag) in sent:
#if tag is DTDEF i want to get the tag after it
if tag=="DTDEF":
tags[count]=tag[acutalIndex+1]
count+=1
fd = nltk.FreqDist(tags)
fd.tabulate()
Thank you in advance for your answer and advice.