5

If you look at the original Wordnet search and select "Display options: Show Lexical File Info", you'll see an extremely useful classification of words called lexical file. Eg for "filling" we have:

   <noun.substance>S: (n) filling, fill (any material that fills a space or container)
   <noun.process>S: (n) filling (flow into something (as a container))
   <noun.food>S: (n) filling (a food mixture used to fill pastry or sandwiches etc.)
   <noun.artifact>S: (n) woof, weft, filling, pick (the yarn woven across the warp yarn in weaving)
   <noun.artifact>S: (n) filling ((dentistry) a dental appliance consisting of ...)
   <noun.act>S: (n) filling (the act of filling something) 

The first thing in brackets is the "lexical file". Unfortunately I have not been able to find a SPARQL endpoint that provides this info

  • The latest RDF translation of Wordnet 3.0 points to two things:

  • Talis SPARQL endpoint. Use eg this query to check there's no such info:

    DESCRIBE <http://purl.org/vocabularies/princeton/wn30/synset-chair-noun-1>

  • W3C's mapping description. Appendix D "Conversion details" describes something useful: wn:classifiedByTopic. But it's not the same as lexical file, and is quite incomplete. Eg "chair" has nothing, while one of the senses of "completion" is in the topic "American Football"

    DESCRIBE <http://purl.org/vocabularies/princeton/wn30/synset-completion-noun-1> ->

    <j.1:classifiedByTopic rdf:resource="http://purl.org/vocabularies/princeton/wn30/synset-American_football-noun-1"/>

The question: is there a public Wordnet query API, or a database, that provides the lexical file information?

4

5 回答 5

5

使用 Python NLTK 接口:

from nltk.corpus import wordnet as wn

for synset in wn.synsets('can'):
    print  synset.lexname
于 2014-07-08T11:40:42.390 回答
4

我认为您无法在 WordNet 的 RDF/OWL 表示中找到它。虽然它在 WordNet 发行版中:dict/lexnames. 以下是 WordNet 3.0 的文件内容:

00      adj.all 3
01      adj.pert        3 
02      adv.all 4
03      noun.Tops       1  
04      noun.act        1
05      noun.animal     1
06      noun.artifact   1
07      noun.attribute  1
08      noun.body       1
09      noun.cognition  1
10      noun.communication      1
11      noun.event      1
12      noun.feeling    1
13      noun.food       1
14      noun.group      1
15      noun.location   1
16      noun.motive     1
17      noun.object     1
18      noun.person     1
19      noun.phenomenon 1
20      noun.plant      1
21      noun.possession 1
22      noun.process    1
23      noun.quantity   1
24      noun.relation   1
25      noun.shape      1
26      noun.state      1
27      noun.substance  1
28      noun.time       1
29      verb.body       2
30      verb.change     2
31      verb.cognition  2
32      verb.communication      2
33      verb.competition        2
34      verb.consumption        2
35      verb.contact    2
36      verb.creation   2
37      verb.emotion    2
38      verb.motion     2
39      verb.perception 2
40      verb.possession 2
41      verb.social     2
42      verb.stative    2
43      verb.weather    2
44      adj.ppl 3

对于 dict/data.* 的每个条目,第二个数字是词法文件信息。例如,这个填充条目包含数字 13,即 noun.food。

07883031 13 n 01 filling 0 002 @ 07882497 n 0000 ~ 07883156 n 0000 | a food mixture used to fill pastry or sandwiches etc.
于 2012-02-06T11:26:00.140 回答
2

它可以通过MIT JWI (MIT Java Wordnet Interface) 一个 Java API 来查询 Wordnet。这个链接中有一个主题展示了如何实现一个java类来访问字典

于 2013-04-10T18:57:55.643 回答
2

这对我有用,

Synset[] synsets = database.getSynsets(wordStr);

ReferenceSynset referenceSynset = (ReferenceSynset) synsets[i];

int lexicalCode =referenceSynset.getLexicalFileNumber();

然后使用上表推断“lexnames”,例如 noun.time

于 2013-09-01T17:32:54.233 回答
0

如果你在 Windows 上,它很可能在你的 appdata 中,在本地目录中。要到达那里,您需要打开文件浏览器,转到顶部,然后输入 %appdata%

接下来点击漫游,然后找到nltk_data目录。在那里,您将拥有您的语料库文件。完整路径类似于:C:\Users\yourname\AppData\Roaming\nltk_data\corpora

并且 lexnames 将出现在 C:\Users\yourname\AppData\Roaming\nltk_data\corpora\wordnet 下。

于 2019-07-02T18:01:29.873 回答