【发布时间】:2013-01-25 16:08:07
【问题描述】:
我有以下代码:
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)
现在,由于一些非常奇怪的原因,我收到以下错误: “类别 = re.match(self._pattern, file_id).group(1) AttributeError: 'NoneType' 对象没有属性 'group'"
有人知道那是什么意思吗?
【问题讨论】:
标签: nltk