【发布时间】:2022-01-09 11:21:49
【问题描述】:
我正在尝试使用 NLTK 分析 Python 中的文本,但是当我运行程序时,我收到一个错误,提示 TypeError: 'LazyCorpusLoader' object is not callable。我不确定为什么会出现这个错误。
import re
import csv
import nltk
class project:
def __init__(self):
self.ReadDoc()
def ReadDoc(self):
PPV = nltk.corpus.words('/Users/documents/project/docs/txt/file.txt')
PPV = ' '.join(PPV)
【问题讨论】: