For Application Developers
Q. What is the format of the WordNet database?
A. The (ASCII) database format is well-documented. See WordNet documentation index, specifically WordNet man page: wndb.5WN.
Q. I want to use WordNet in another program. What can I do?
A. WordNet provides a C API to use WordNet from a C program. The API documentation is available online and is distributed with the main WordNet packages. Interfaces for many other languages are available via our related projects page.
Q. What is the format for the query string to the web interface?
A. In addition to the word being searched for, the query string contains parameters which specify the display options and changes to the default display options. It also contains parameters that describe the level of detail to use for each synset or relation listed in the results.
In a query like this (when you search for the word "quintillion")
-
The 's' parameter is the word being searched for.
-
'sub' reports which submit button was clicked i.e. Search WordNet or Change. It is left empty if nothing was clicked, maybe one of the hyperlinks was clicked instead.
-
The 'o1', 'o2' etc. are variables for the display options. By default o0 (Example Sentences) and o1 (Glosses) are set to 1 and the others aren't set.
-
The 'c' parameter specifies the option that should be toggled. Choosing a display option from the drop-down list sets the c parameter to the correct value.
History list
-
The 'h' parameter is a history list (a list of digits [0-3]* like 10000). Each digit corresponds to a synset or relation hyperlink in the results. A 1, 2 or 3 indicates that the the synset or relation is expanded, while a 0 indicates otherwise.
- The 'i' parameter is the last index to be expanded in the history list, in addition to what is already specified using h.
- And 'j' is the index in the history list to jump to.
For example: http://wordnetweb.princeton.edu/perl/webwn?o2=&o0=1&o7=&o5=&o1=1&o6=&o4=&o3=&s=trope&i=4&h=10000#ch=10000 will display the five items associated with the word trope with the first list item (the synset S: (n) trope, figure of speech, figure...) expanded and the next four compressed. The i=4 says that the item with index 4 (the relation derivationally related form) should be expanded as well.
Clicking the derivationally related form link will, in turn, load a new page (http://wordnetweb.princeton.edu/perl/webwn?o2=&o0=1&o7=&o5=&o1=1&o6=&o4=&o3=&s=trope&h=10000&j=4#c) where this item is collapsed (j=4 is the index to jump to).
Recursive search
-
The 'r' or recursive search parameter can be 1 or not set at all.
For example clicking on the full hyponym option on http://wordnetweb.princeton.edu/perl/webwn?o2=&o0=1&o7=&o5=&o1=1&o6=&o4=&o3=&s=trope&i=0&h=0#c will load a new page displaying all the hyponyms of the synset, as well as the hyponyms' hyponyms. This is because r is set to 1 in the new URL. Removing the r parameter or the 1 will collapse the second level of hyponyms.
The order of the parameters doesn't matter.
The order of the parameters doesn't matter.
