net.sf.extjwnl.data.relationship
Class RelationshipFinder

java.lang.Object
  extended by net.sf.extjwnl.data.relationship.RelationshipFinder

public class RelationshipFinder
extends Object

Helper class to find relations.

Author:
John Didion , Aliaksandr Autayeu

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

Method Detail

getImmediateRelationship

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

Parameters:
sourceWord - source word
targetWord - target word
Returns:
int the sense of the source word that contains the target word

findRelationships

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

Parameters:
sourceSynset - source synset
targetSynset - target synset
type - pointer type
Returns:
all relationships of type type between sourceSynset and targetSynset
Throws:
CloneNotSupportedException - CloneNotSupportedException

findRelationships

public static RelationshipList findRelationships(Synset sourceSynset,
                                                 Synset targetSynset,
                                                 PointerType type,
                                                 int depth)
                                          throws CloneNotSupportedException
Finds 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.

Parameters:
sourceSynset - source synset
targetSynset - target synset
type - pointer type
depth - depth
Returns:
all relationships of type type between sourceSynset and targetSynset
Throws:
CloneNotSupportedException - CloneNotSupportedException


Copyright © 2011. All Rights Reserved.