extJWNL (Extended Java WordNet Library) is a Java API for creating, reading and updating dictionaries in WordNet format. extJWNL supports:
- writing dictionaries
- encodings (including UTF-8)
- Java generics
- huge dictionaries
- instance dictionaries
- Maven support
- documentation improvements
- improved unit test coverage
- enhanced database support
- simplified configuration
- multiple other improvements and fixes
In the pom.xml:
<!-- main library dependency --> <dependency> <groupId>net.sf.extjwnl</groupId> <artifactId>extjwnl</artifactId> <version>1.9.4</version> </dependency> <!-- Princeton WordNet 3.1 data dependency --> <dependency> <groupId>net.sf.extjwnl</groupId> <artifactId>extjwnl-data-wn31</artifactId> <version>1.2</version> </dependency>
In the code:
Dictionary d = Dictionary.getDefaultResourceInstance();
extJWNL contains Examples.java with examples of API use.
WordNet Data Dependencies
extJWNL can load WordNet data from resources on the classpath. One way to do that is to add a dependency like illustrated above. There are several dependencies available that contain data from Princeton WordNet:
- extjwnl-data-wn21 WordNet 2.1 Unix version (text)
- extjwnl-data-wn30 WordNet 3.0 Unix version (text)
- extjwnl-data-wn31 WordNet 3.1 Unix version (text)
- extjwnl-data-wn31-map WordNet 3.1 Unix version (serialized)
Dependencies with text data contain original Princeton WordNet files augmented with extJWNL configuration file. Dependencies with serialized data contain Princeton WordNet files serialized into HashMaps and augmented with extJWNL configuration file.
Serialized data is larger, but might work faster for some use cases.
If you use
Dictionary.getDefaultResourceInstance(), then make sure you use only one dependency.
extJWNL is supported by YourKit Open Source License. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.