简体   繁体   English

如何从普林斯顿英语 WordNet 获取词性和单词列表?

[英]How to get a list of parts of speech and words from Princeton English WordNet?

I'd like a complete list of parts of speech (eg, adj., adv., and .v) for English words.我想要一个完整的英语单词词性列表(例如,adj.、adv. 和 .v)。 All I need is just a TSV table with two columns, with the first column the word and the second column POS.我所需要的只是一个包含两列的 TSV 表,第一列是单词,第二列是 POS。

I know that wordnet should contain such information.我知道 wordnet 应该包含这样的信息。 But it contains more than what I needed.但它包含的比我需要的要多。 I am not sure which file I should use.我不确定应该使用哪个文件。

https://wordnet.princeton.edu/download https://wordnet.princeton.edu/download

Does anybody know a convenience-to-use file that contains English words and their POS?有谁知道一个包含英文单词和它们的 POS 的方便使用的文件吗? Thanks.谢谢。

Wordnet doesn't give you "word" per say but lemmas. Wordnet 不会给你“词”,而是词条。

from nltk.corpus import wordnet as wn

for ss in wn.all_synsets():
    for lemma in ss.lemma_names():
        print(ss.offset() + '\t' + ss.pos() +'\t' + lemma)

See

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM