I have a question regarding Python concordance command in NLTK. First, I came through an easy example:
from nltk.book import *
text1.concordance("monstrous")
which worked just fine. Now, I have my own .txt file and I would like to perform the same command. I have a list called "textList" and want to find the word "CNA" so I put command
textList.concordance('CNA')
Yet, I got the error
AttributeError: 'list' object has no attribute 'concordance'.
In the example, is the text1 NOT a list? I wonder what is going on here.