/** Get an array of all the targets of <code>pointers</code>.*/ private PointerTarget[] collectTargets(Pointer[] pointers) throws JWNLException { PointerTarget[] targets = new PointerTarget[pointers.length]; for (int i = 0; i < pointers.length; ++i) targets[i] = pointers[i].getTarget(); return targets; } }
/** * Get the synset that is a) the target of this pointer, or b) the * synset that contains the target of this pointer. */ public Synset getTargetSynset() throws JWNLException { PointerTarget target = getTarget(); if (target instanceof Word) { return ((Word) target).getSynset(); } else { return (Synset) target; } }
public Set<SensedWord> getNeighborSensedWords(WordNetRelation relation) throws WordNetException { Set<SensedWord> sensedWords = new HashSet<SensedWord>(); if (relation.isLexical()) { PointerType pointerType = JwnlUtils.wordNetRelationToPointerType(relation); if (pointerType != null) { Pointer[] pointers = wordObj.getPointers(pointerType); for (Pointer pointer : pointers) try { sensedWords.add( new JwnlSensedWord(((Word) pointer.getTarget()), dictionary)); } catch (JWNLException e) { throw new WordNetException("See nested",e); } } } return sensedWords; }