这是代码:
import nltk
from nltk.stem.snowball import SnowballStemmer
stemmer = SnowballStemmer(language='english')
stem = []
lines2 = ["test"]
for words in lines2:
stem.append(stemmer.stem(words))
print(stem)
错误:
line 82, in <module>
stem.append(stemmer.StemWords(words))
AttributeError: 'SnowballStemmer' object has no attribute 'StemWords'
我很高兴能得到任何帮助来解决这个问题。先感谢您。