I am currently learning about NLP in Python and I am getting problems with a Python syntax.
cfd = nltk.ConditionalFreqDist( #create conditional freq dist
(target, fileid[:4]) #create target (Y) and years (X)
for fileid in inaugural.fileids() #loop through all fileids
for w in inaugural.words(fileid) #loop through each word of each fileids
for target in ['america','citizen'] #loop through target
if w.lower().startswith(target)) #if w.lower() starts with target words
cfd.plot() # plot it
I do not understand the purpose of line 2. Moreover, I do not understand why each loop doesn't end with ":" like any loops in Python.
Can someone explain me this code ? The code works, but I do not fully understand its syntax.
Thank you