How do I set up extJWNL in a Java project?

444 views Asked by At

I am trying to determine whether a set of strings, from an English sentence, are all words from the WordNet dictionary. I put the JARs in a folder in my project in eclipse.

I've downloaded the binary release of extJWNL and put the JARs in a folder called lib.

The project hierarchy in Eclipse IDE with the folder called lib which contains the JARs expanded

I also added these jar files to the class path and the module path using Right Click > Build Path > Configure Build Path:

JAR files under the modulepath and classpath in the properties of the current Java project in Eclipse

I used the following code to try to import dictionary

import net.sf.extjwnl.dictionary;

This error is shown on the import statement

The package net.sf.extjwnl.dictionary is accessible from more than one module: <unnamed>, extjwnl

I thought that this error was showing up because it was a package, not a class/type. But adding a new class and trying to change the package doesn't show this new package, namely WORDNET_JARS, just the default package.

Why is this error being returned and what do I need to do to get rid of the error and import the wordnet packages?

Platforms

I am using Eclipse IDE, and write all this code in Java. The API I am trying to import is the WordNet API.

Edit (8/21/2019)

By removing the module path, it gives a new error:

Only a type can be imported. net.sf.extjwnl.dictionary resolves to a package

1

There are 1 answers

0
Marvin On BEST ANSWER

I'm surprised it was this easy:

Instead of

import net.sf.extjwnl.dictionary

I had to do

import net.sf.extjwnl.dictionary.*

to get all the types. The only other thing that had to be done had already been done where I add the JARs to the class path