JWNL v1.1
JWNL is an API for accessing WordNet-style relational dictionaries. It also provides functionality beyond data access, such as relationship discovery and morphological processing.
Contents:
Changes From Earlier Versions
Version 1.1 is has changed significantly from earlier versions. So much so, in fact, that it is not backwardly compatible with earlier versions. For this reason, earlier versions will no longer be supported.
The major changes in version 1.1 are:
- Brand new architecture which enables JWNL to be completely driven off a properties file
- Internationalization through the use of property bundles
- Logging
- All data structures were brought into the Collections framework
- More logical organization of packages and classes
- Abstraction of dictionary-specific code to facilitate the use of JWNL with other WordNet-like dictionaries (see Architecture Notes for more on this)
- Bug fixes
Architecture Notes
In developing the architecture for this version of JWNL, the overall design goals were:
To make set-up and use of JWNL as simple, and require as little extra code, as possible. A major component of this was making JWNL run off a property file. This resulted in a plugin-style architecture. For example, in the properties file, you specify what type of dictionary interface you want to use via the <dictionary> tag. The class you specify is loaded during initialization and is set as the Dictionary class' singleton instance.
To make it specific enough that a concrete implemententation could be provided, but general enough that it could be used, with as little effort as possible, to be used with any WordNet-like dictionary. A WordNet-like dictionary is one that uses the same concepts and structures (indexes, synsets, exceptions, pointers, etc. In all likelyhood, the attemps made at abstraction of dictionary specific code in this version will not be sufficient for using non-English dictionaries, since other languages may have different syntaxes. But the current architecture does make it easy to adapt the system to new versions of WordNet with little work. This is done by delegating the creation of data objects to a factory class, which, like Dictionary, can be changed simply by changing a line in the property file.
To internationalize the text. This is done through the use of property bundles.
Basic Usage
Using JWNL is very simple. First, call JWNL.initialize() somewhere in the initialization code of your program.
Then, just call Dictionary.getInstance() to get the currently installed dictionary. The only dictionary methods you should really ever need to call are lookupIndexWord(), lookupAllIndexWords(), and getIndexWordIterator().
The other methods you may be interested in Relationship.findRelationships(), and those in PointerUtils.
Relationship.findRelationships() allows you to find relationships of a given type between two words (such as ancestry). Another way of thinking of a relationship is as a path from the source synset to the target synset.
The methods in PointerUtils allow you to find chains of pointers of a given type. For example, calling PointerUtils.getHypernymTree() on the synset that contains "dog," returns a tree with all its parent synsets ("canine"), and its parents' parents ("carnivore"), etc., all the way to the root synset ("entity").
Goals for Future Releases
There are many areas in which JWNL needs improvement:
- Support for non-english dictionaries
- A GUI for browsing the dictionary
- Better documentation, logging, and error messages
- Better morphological processing
- The ability to use a database-backed dictionary, and utilities for loading the dictionary data into a database
As JWNL is now officially an open-source project, you are encouraged to improve JWNL in any of these areas, or any other areas in which you see fit.