de.tuebingen.uni.sfs.germanet.relatedness
Class HsoMethods
java.lang.Object
de.tuebingen.uni.sfs.germanet.relatedness.HsoMethods
public class HsoMethods
- extends java.lang.Object
Methods used by the Hirst and St-Onge measure in Relatedness.java.
Method Summary |
static double |
checkConRels(de.tuebingen.uni.sfs.germanet.api.ConRel[] rels,
de.tuebingen.uni.sfs.germanet.api.Synset s,
de.tuebingen.uni.sfs.germanet.api.Synset s2,
java.lang.String path,
double score,
double c,
double k,
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> visited)
Runs through all ConRel relations in the given array and checks the
resulting paths. |
static double |
checkLexRels(de.tuebingen.uni.sfs.germanet.api.LexRel[] rels,
de.tuebingen.uni.sfs.germanet.api.Synset s,
de.tuebingen.uni.sfs.germanet.api.Synset s2,
java.lang.String path,
double score,
double c,
double k,
de.tuebingen.uni.sfs.germanet.api.LexUnit u,
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> visited)
Runs through all LexRel relations in the given array and checks the
resulting paths. |
static double |
findBestPath(de.tuebingen.uni.sfs.germanet.api.Synset s,
de.tuebingen.uni.sfs.germanet.api.Synset s2,
java.util.List<de.tuebingen.uni.sfs.germanet.api.LexUnit> lexUnits,
java.lang.String path,
double score,
double c,
double k,
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> visited)
Recursively finds all possible paths from s to s2 and returns the score
of the best one. |
static double |
getScore(double oldScore,
java.lang.String path,
double c,
double k)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
upwardRelations
public static de.tuebingen.uni.sfs.germanet.api.ConRel[] upwardRelations
downwardRelations
public static de.tuebingen.uni.sfs.germanet.api.ConRel[] downwardRelations
horizontalRelations
public static de.tuebingen.uni.sfs.germanet.api.ConRel[] horizontalRelations
horizontalRels
public static de.tuebingen.uni.sfs.germanet.api.LexRel[] horizontalRels
allowedPaths
public static java.lang.String allowedPaths
HsoMethods
public HsoMethods()
findBestPath
public static double findBestPath(de.tuebingen.uni.sfs.germanet.api.Synset s,
de.tuebingen.uni.sfs.germanet.api.Synset s2,
java.util.List<de.tuebingen.uni.sfs.germanet.api.LexUnit> lexUnits,
java.lang.String path,
double score,
double c,
double k,
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> visited)
- Recursively finds all possible paths from s to s2 and returns the score
of the best one.
- Parameters:
s
- staring synsets2
- target synsetlexUnits
- lexUnits of spath
- path up to this point (recursive method)score
- best score to this pointc
- constant given to HirstAndStOnge measure at startk
- constant given to HirstAndStOnge measure at start
- Returns:
- the best score found along all paths from s to s2
checkConRels
public static double checkConRels(de.tuebingen.uni.sfs.germanet.api.ConRel[] rels,
de.tuebingen.uni.sfs.germanet.api.Synset s,
de.tuebingen.uni.sfs.germanet.api.Synset s2,
java.lang.String path,
double score,
double c,
double k,
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> visited)
- Runs through all ConRel relations in the given array and checks the
resulting paths. The highest score is returned;
if no score is better than the current one, the current score is returned.
- Parameters:
rels
- relations to be checkeds
- staring synsets2
- target synsetpath
- path up to this point (recursive method)score
- best score to this pointc
- constant given to HirstAndStOnge measure at startk
- constant given to HirstAndStOnge measure at start
- Returns:
- the best score found along the paths involving this step
checkLexRels
public static double checkLexRels(de.tuebingen.uni.sfs.germanet.api.LexRel[] rels,
de.tuebingen.uni.sfs.germanet.api.Synset s,
de.tuebingen.uni.sfs.germanet.api.Synset s2,
java.lang.String path,
double score,
double c,
double k,
de.tuebingen.uni.sfs.germanet.api.LexUnit u,
java.util.HashSet<de.tuebingen.uni.sfs.germanet.api.Synset> visited)
- Runs through all LexRel relations in the given array and checks the
resulting paths.
The highest score is returned; if no score is better than the
current one, the current score is returned.
- Parameters:
rels
- relations to be checkeds
- staring synsets2
- target synsetpath
- path up to this point (recursive method)score
- best score to this pointc
- constant given to HirstAndStOnge measure at startk
- constant given to HirstAndStOnge measure at start
- Returns:
- the best score found along the paths involving this step
getScore
public static double getScore(double oldScore,
java.lang.String path,
double c,
double k)