net.didion.jwnl.data.relationship
Class RelationshipFinder

java.lang.Object
  extended by net.didion.jwnl.data.relationship.RelationshipFinder

public class RelationshipFinder
extends java.lang.Object


Method Summary
 RelationshipList findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type)
          Find all relationships of type type between sourceSynset and targetSynset.
 RelationshipList findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type, int depth)
          Find all relationships of type type between sourceSynset and targetSynset to depth depth.
 int getImmediateRelationship(IndexWord sourceWord, IndexWord targetWord)
          Looks at whether the target word is one of the words in one of the synsets of the source word.
static RelationshipFinder getInstance()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RelationshipFinder getInstance()

getImmediateRelationship

public int getImmediateRelationship(IndexWord sourceWord,
                                    IndexWord targetWord)
                             throws JWNLException
Looks at whether the target word is one of the words in one of the synsets of the source word.

Returns:
int the sense of the source word that contains the target word
Throws:
JWNLException

findRelationships

public RelationshipList findRelationships(Synset sourceSynset,
                                          Synset targetSynset,
                                          PointerType type)
                                   throws JWNLException
Find all relationships of type type between sourceSynset and targetSynset. This method creates a symmetric or asymmetric relationship based on whether type is symmetric.

Throws:
JWNLException

findRelationships

public RelationshipList findRelationships(Synset sourceSynset,
                                          Synset targetSynset,
                                          PointerType type,
                                          int depth)
                                   throws JWNLException
Find all relationships of type type between sourceSynset and targetSynset to depth depth. This method creates a symmetric or asymmetric relationship based on whether type is symmetric.

Throws:
JWNLException