Class RelationshipFinder
- java.lang.Object
-
- net.didion.jwnl.data.relationship.RelationshipFinder
-
public class RelationshipFinder extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
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
-
-