de.tuebingen.uni.sfs.germanet.relatedness
Class HsoMethods

java.lang.Object
  extended by 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.


Field Summary
static java.lang.String allowedPaths
           
static de.tuebingen.uni.sfs.germanet.api.ConRel[] downwardRelations
           
static de.tuebingen.uni.sfs.germanet.api.ConRel[] horizontalRelations
           
static de.tuebingen.uni.sfs.germanet.api.LexRel[] horizontalRels
           
static de.tuebingen.uni.sfs.germanet.api.ConRel[] upwardRelations
           
 
Constructor Summary
HsoMethods()
           
 
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
 

Field Detail

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
Constructor Detail

HsoMethods

public HsoMethods()
Method Detail

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 synset
s2 - target synset
lexUnits - lexUnits of s
path - path up to this point (recursive method)
score - best score to this point
c - constant given to HirstAndStOnge measure at start
k - 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 checked
s - staring synset
s2 - target synset
path - path up to this point (recursive method)
score - best score to this point
c - constant given to HirstAndStOnge measure at start
k - 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 checked
s - staring synset
s2 - target synset
path - path up to this point (recursive method)
score - best score to this point
c - constant given to HirstAndStOnge measure at start
k - 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)