All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.didion.jwnl.dictionary.morph.LookupIndexWordOperation Maven / Gradle / Ivy

Go to download

JWNL is an API for accessing WordNet in multiple formats, as well as relationship discovery and morphological processing.

There is a newer version: 1.4_rc3
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy