我有以下代码:
corpus= CategorizedPlaintextCorpusReader(loc,'(?!\.svn).*\.txt', cat_pattern=r'(Shakespeare|Milton)/.*')
cfd=nltk.ConditionalFreqDist ((genre,word)
for genre in corpus.categories()
for word in corpus.words(categories = genre))
genres=['Shakespeare','Milton']
pronouns=['I','you','he','she', 'it','we','they']
cfd.tabulate (conditions=genres,samples=pronouns)
现在,由于一些非常奇怪的原因,我收到以下错误:“category = re.match(self._pattern, file_id).group(1) AttributeError: 'NoneType' object has no attribute 'group'”
有人知道那是什么吗?