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.
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.