【发布时间】:2016-02-24 11:34:15
【问题描述】:
我有一个用例,我有一个词,我需要知道以下几点:
- 单词的同义词(同义词就足够了)
- 单词的所有含义,其中每个含义包含 - 在该含义中匹配该单词的同义词、该含义中的例句(如果存在)、该含义的词性。
示例 - this query link。 carry这个词的截图:
对于每个“意义”,我们都有词性(如V),与该意义匹配的同义词,(如第一种意义的transport,第二种意义的pack,take,等等),包含该单词的例句(This train is carrying nuclear waste、carry the suitcase to the car 等在第一意义上,I always carry money 等在第二意义上等)。
如何通过Wordnet MySQL database 执行此操作?我运行了这个查询,它返回了单词的含义列表:
SELECT a.lemma, c.definition FROM words a INNER JOIN senses b ON a.wordid = b.wordid INNER JOIN synsets c ON b.synsetid = c.synsetid WHERE a.lemma = 'carry';
我如何获得每个意义特定于该意义的同义词、例句、词性和同义词?我查询了vframesentences 和vframesentencemaps 表,看到了带有%s 等占位符的例句,并基于wordid 列,我尝试将它们与words 表匹配,但得到的结果非常错误。
编辑:
对于单词carry,如果我运行这些查询,我会得到同义词并正确理解含义:
1. select * from words where lemma='carry' //yield wordid as 21354
2. select * from senses where wordid=21354 //yield 41 sysnsetids, like 201062889
3. select * from synsets where synsetid=201062889 //yields the explanation "serve as a means for expressing something"
4. select * from senses where synsetid=20106288` /yields all matching synonyms for that sense as wordids, including "carry" - like 21354, 29630, 45011
5. select * from words where wordid=29630 //yields 'convey'
所以我现在需要的只是在 41 种感官中找到单词 carry 的例句。我该怎么做?
【问题讨论】:
-
“c.definition”给你什么?我不熟悉 WordNet 数据库。如果您向我提供有关 wordnet 数据库表外观的在线文档,我可以为您提供更多帮助。 "c.definition" 为您提供如下项目符号列表?
S: (v) transport, carry (move while supporting, either in a vehicle or in one's hands or on one's body) "You must carry your camping gear"; "carry the suitcases ..."S: (v) carry, pack, take (have with oneself; have on one's person) "She always takes an umbrella"; "I always carry money"; "She packs ..." ... -
我认为
definition只是提供了定义..
标签: mysql sql words wordnet lexicon