This is an implementation of a WordNet Resource based MapBackedDictionary and Data. It is an extension of the extJWNL Java library. The compiled jar not only has an instance of a MapBackedDictionary but a compiled version of the WordNet data.
Important: This repo is deprecated and moved to the extjwnl map project. Please use that library instead of this one.
In your pom.xml
file add
the
dependency XML element below:
<dependency>
<groupId>com.zensols.nlp</groupId>
<artifactId>wordnet-mapres</artifactId>
<version>0.0.1</version>
</dependency>
Like any extJWNL dictionary, you resolve the dictionary using
Dictionary.getResourceInstance()
, but use the resource XML given in the
library as such:
Dictionary dict = Dictionary.getResourceInstance("/net/sf/extjwnl/data/wordnet/wn31/map/res_properties.xml");
IndexWordSet wordSet = dict.lookupAllIndexWords("cat");
Assert.assertNotNull(wordSet);
IndexWord indexWord = wordSet.getIndexWord(POS.NOUN);
System.out.println(indexWord)
See the unit test for a more in-depth example.
More documentation:
The data file is built from the WordNet dependency data file (see WordNet Data section) by:
- Downloading by depndency definition
- Extracting the jar data files
- Adding XML dictionary properties file.
- Compiling and adding a Princeton object map backed dictionary implementation.
This is done with the make wndat
command (see build section).
The WordNet data comes from the latest extJWNL release:
<dependency>
<groupId>net.sf.extjwnl</groupId>
<artifactId>extjwnl-data-wn31</artifactId>
<version>1.2</version>
</dependency>
To build from source, do the folling:
- Install Maven
- Install GNU make (optional)
- Build the software:
make
- Build the distribution binaries:
make package
An extensive changelog is available here.
Copyright © 2017 Paul Landes
Apache License version 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.