public class RelationshipFinder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
DEFAULT_ASYMMETRIC_SEARCH_DEPTH |
private static int |
DEFAULT_SYMMETRIC_SEARCH_DEPTH |
private static RelationshipFinder |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
private |
RelationshipFinder() |
| Modifier and Type | Method and Description |
|---|---|
private void |
buildSymmetricRelationshipList(PointerTargetNodeList list,
PointerTargetTreeNode node)
Build the relationship.
|
private Relationship |
findAsymmetricRelationship(PointerTargetNodeList sourceNodes,
PointerTargetNodeList targetNodes,
PointerType type,
Synset sourceSynset,
Synset targetSynset)
Find a relationship between two asymmetric lists ordered from deepest
to shallowest ancestor.
|
private RelationshipList |
findAsymmetricRelationships(Synset sourceSynset,
Synset targetSynset,
PointerType type)
Finds the asymmetric relationship(s) between two words.
|
private RelationshipList |
findAsymmetricRelationships(Synset sourceSynset,
Synset targetSynset,
PointerType type,
int depth)
Finds the asymmetric relationship(s) between two words.
|
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.
|
private PointerTargetNodeList |
findSymmetricRelationship(PointerTargetTreeNode node,
PointerType type)
Build a relationsip from node back to it's root ancestor and
then reverse the list.
|
private RelationshipList |
findSymmetricRelationships(Synset sourceSynset,
Synset targetSynset,
PointerType type)
A symmetric relationship is one whose type is symmetric (i.e.
|
private RelationshipList |
findSymmetricRelationships(Synset sourceSynset,
Synset targetSynset,
PointerType type,
int depth)
A symmetric relationship is one whose type is symmetric (i.e.
|
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() |
private static final int DEFAULT_ASYMMETRIC_SEARCH_DEPTH
private static final int DEFAULT_SYMMETRIC_SEARCH_DEPTH
private static final RelationshipFinder INSTANCE
public static RelationshipFinder getInstance()
public int getImmediateRelationship(IndexWord sourceWord, IndexWord targetWord) throws JWNLException
JWNLExceptionpublic RelationshipList findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type) throws JWNLException
JWNLExceptionpublic RelationshipList findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type, int depth) throws JWNLException
JWNLExceptionprivate RelationshipList findAsymmetricRelationships(Synset sourceSynset, Synset targetSynset, PointerType type) throws JWNLException
JWNLExceptionprivate RelationshipList findAsymmetricRelationships(Synset sourceSynset, Synset targetSynset, PointerType type, int depth) throws JWNLException
JWNLExceptionprivate Relationship findAsymmetricRelationship(PointerTargetNodeList sourceNodes, PointerTargetNodeList targetNodes, PointerType type, Synset sourceSynset, Synset targetSynset)
private RelationshipList findSymmetricRelationships(Synset sourceSynset, Synset targetSynset, PointerType type) throws JWNLException
JWNLExceptionprivate RelationshipList findSymmetricRelationships(Synset sourceSynset, Synset targetSynset, PointerType type, int depth) throws JWNLException
JWNLExceptionprivate PointerTargetNodeList findSymmetricRelationship(PointerTargetTreeNode node, PointerType type)
private void buildSymmetricRelationshipList(PointerTargetNodeList list, PointerTargetTreeNode node)