I need a method:
public static boolean hypernymOfPerson (String noun)
...to determine if the noun provided is a hyponym of person or not.
Has anyone made such a method? If not, can anyone give me a hint on how to extract that particular information from the pointerTargetTree object?
Any help greatly appreciated!
Hacked it. This piece of code seems to work:
public boolean hyponymOfPerson (String str)
boolean isPerson = false;
word1 = Dictionary.getInstance().lookupIndexWord(POS.NOUN, "person");
word2 = Dictionary.getInstance().lookupIndexWord(POS.NOUN, str);
// Find out how many senses there are of the supplied word:
senses = synset.length;
//System.out.println ("There are " + senses + " senses of the word \"" + str + "\" (noun) :" );
catch (Exception ex)
return false; // The word doesn't appear in the dictionary
sense = PointerUtils.getInstance().getHypernymTree(word2.getSense(1));
System.out.println ("Sense: " + sense + " class: " + sense.getClass());
if (sense.findFirst((PointerTarget) word1.getSense(1)) == null)
isPerson = false;
isPerson = true;
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.