使用 WordNet 创建一个简单的字典
我正在从 http://www.semantilog.org/wn2sql.html 在 MySQL 中安装 WordNet
我想以与普林斯顿网页相同的方式显示数据:http://wordnetweb.princeton.edu/perl/webwn?s=car
我如何查询数据库这样做吗?我正在使用 PHP。
I'm installing WordNet in MySQL from http://www.semantilog.org/wn2sql.html
I'd like to display the data in the same way as Princeton's webpage: http://wordnetweb.princeton.edu/perl/webwn?s=car
How would I query the database to do that? I'm using PHP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我从网站上的文档中收集到的信息来看,您似乎需要查询三个表。
首先,您查询 word 表以获得其 wordno,即每个单词具有的唯一编号。它看起来像这样。
接下来,我们需要查询sense表以获得synsetno,它将输出单词的不同含义。例如:can(名词)和can(动词),每个都有一个唯一的编号,即 synsetno
MySQL 查询将类似于:
对于从该查询中获得的每个结果,您'你必须查询synset表来获取每个意义的定义。 Can(名词)和can(动词)有不同的定义。每个 synsetno 的查询。
很快!你自己有一本很酷的字典。然而,必须查询三个表,每个表都有大量记录,这对 CPU 来说是一种痛苦。
From what I gather from the documentation on the website, it seems you need to query three tables.
First you query the word table in order to get it's wordno, a unique number each word has. It would look something like this.
Next, we need to query the sense table in order to get the synsetno, which'll output the different senses of the word. Ex: can (noun) and can (verb), each have a unique number which is the synsetno
The MySQL query will be something along the lines of:
For each result you get from that query, you'll have to query the synset table to get the definition of each sense. Can (noun) and can (verb) have different definitions. The query for each synsetno.
And presto! You have yourself a pretty cool dictionary. It is a pain on the CPU, however, to have to query three tables, each with a ton of records.