net.didion.jwnl.dictionary.morph.LookupIndexWordOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwnl Show documentation
Show all versions of jwnl Show documentation
JWNL is an API for accessing WordNet in multiple formats, as well as relationship discovery and morphological processing.
package net.didion.jwnl.dictionary.morph;
import net.didion.jwnl.data.POS;
import net.didion.jwnl.JWNLException;
import net.didion.jwnl.dictionary.Dictionary;
import java.util.Map;
public class LookupIndexWordOperation implements Operation {
public Object create(Map params) throws JWNLException {
return new LookupIndexWordOperation();
}
public boolean execute(POS pos, String lemma, BaseFormSet baseForms) throws JWNLException {
if (Dictionary.getInstance().getIndexWord(pos, lemma) != null) {
baseForms.add(lemma);
return true;
}
return false;
}
}