|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tuebingen.uni.sfs.germanet.relatedness.Path
public class Path
A class that finds paths from one synset to the root or from one synset to another. Also includes depth, LCS (least common subsumer) and leaf nodes. Constructor takes the starting synset as input. Uses edge-counting.
Constructor Summary | |
---|---|
Path(de.tuebingen.uni.sfs.germanet.api.Synset synset)
Constructor calculates in advance all paths from given synset to root. |
Method Summary | |
---|---|
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> |
getAllHypernyms()
Returns a HashSet that includes each synset seen on the different ways from this synset to the root exactly once, including the starting synset and the root. |
java.util.ArrayList<java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset>> |
getAllPaths()
Returns all possible paths from the root to this synset. |
int |
getDepth()
Returns the depth of this synset in GermaNet (edge counting). |
int |
getDistance(Path p)
Returns the distance between this synset and the synset in the Path argument. |
de.tuebingen.uni.sfs.germanet.api.Synset |
getInitialSynset()
Returns the Synset used to initialize this Path object. |
java.util.ArrayList<PathNode> |
getLeastCommonSubsumer(Path otherPath)
Returns an ArrayList of least common subsumers (LCS) of this Path object's starting synset and that of the given other Path. |
java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset> |
getLeastCommonSubsumerSynset(Path otherPath)
Returns an ArrayList of Synsets that are LCS of this path object and otherPath |
static java.util.List<de.tuebingen.uni.sfs.germanet.api.Synset> |
getLeaves(de.tuebingen.uni.sfs.germanet.api.GermaNet gnet)
Finds all leaf nodes of the hierarchy. |
java.util.ArrayList<java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset>> |
getShortestPaths()
Returns the shortest path(s) to this synset (there may be more than one). |
java.util.HashMap<PathNode,java.util.ArrayList<PathNode>> |
getVisited()
Returns this Path object's HashMap of nodes seen on different ways up to the root. |
java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset> |
pathToAncestorSynset(de.tuebingen.uni.sfs.germanet.api.Synset synset)
In case that the parameter synset is an ancestor of the current Synset, this method returns the path between the two Synsets. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Path(de.tuebingen.uni.sfs.germanet.api.Synset synset)
synset
- The synset for which a path is built.Method Detail |
---|
public int getDepth()
public java.util.ArrayList<java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset>> getShortestPaths()
public java.util.ArrayList<java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset>> getAllPaths()
public java.util.ArrayList<PathNode> getLeastCommonSubsumer(Path otherPath)
otherPath
- The pathNode with which to find the least common subsumer.
public java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset> getLeastCommonSubsumerSynset(Path otherPath)
otherPath
- the path with which the LCS is to be found
public java.util.ArrayList<de.tuebingen.uni.sfs.germanet.api.Synset> pathToAncestorSynset(de.tuebingen.uni.sfs.germanet.api.Synset synset)
synset
- possible ancestor of the current synset
public java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> getAllHypernyms()
public java.util.HashMap<PathNode,java.util.ArrayList<PathNode>> getVisited()
public int getDistance(Path p)
p
- the other Path object
public static java.util.List<de.tuebingen.uni.sfs.germanet.api.Synset> getLeaves(de.tuebingen.uni.sfs.germanet.api.GermaNet gnet)
gnet
- Instance of Germanet.
public de.tuebingen.uni.sfs.germanet.api.Synset getInitialSynset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |