我有一个wordnet中所有名词的列表,现在我想只留下车辆中的单词并删除其余的单词.我该怎么做?下面是我想要的伪代码,但我不知道如何使其工作
for word in wordlist: if not "vehicle" in wn.synsets(word): wordlist.remove(word)
python nltk wordnet
nltk ×1
python ×1
wordnet ×1