Class ShortestPathMeasure
- java.lang.Object
-
- org.aksw.limes.core.measures.measure.AMeasure
-
- org.aksw.limes.core.measures.measure.semantic.edgecounting.AEdgeCountingSemanticMeasure
-
- org.aksw.limes.core.measures.measure.semantic.edgecounting.measures.ShortestPathMeasure
-
- All Implemented Interfaces:
IMeasure,IEdgeCountingSemanticMeasure
public class ShortestPathMeasure extends AEdgeCountingSemanticMeasure
Implements the Shortest Path semantic string similarity between two concepts (synsets), that considers both the path between two concepts and the depth of the hierarchy.- Version:
- 1.0
- Author:
- Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
-
-
Field Summary
-
Fields inherited from class org.aksw.limes.core.measures.measure.semantic.edgecounting.AEdgeCountingSemanticMeasure
ADJECTIVE_DEPTH, ADVERB_DEPTH, dictionary, Indexer, NOUN_DEPTH, VERB_DEPTH
-
-
Constructor Summary
Constructors Constructor Description ShortestPathMeasure(AIndex Indexer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalculate(edu.mit.jwi.item.ISynset synset1, double shortestPath)Calculates the actual Shortest Path similarity.StringgetName()Returns name of a measure.doublegetRuntimeApproximation(double mappingSize)Returns the runtime approximation of a measure.doublegetSimilarityBetweenConcepts(edu.mit.jwi.item.ISynset synset1, edu.mit.jwi.item.ISynset synset2)Computes the Shortest Path similarity between two concepts.StringgetType()Returns type of a measure.-
Methods inherited from class org.aksw.limes.core.measures.measure.semantic.edgecounting.AEdgeCountingSemanticMeasure
checkSimilarity, close, getHierarchyDepth, getIIndexWord, getIWord, getPaths, getSemanticDictionary, getSimilarity, getSimilarity, getSimilarity, getSimilarity, getSynset, getWordIDs, setDictionary, tokenize
-
-
-
-
Constructor Detail
-
ShortestPathMeasure
public ShortestPathMeasure(AIndex Indexer)
-
-
Method Detail
-
calculate
public double calculate(edu.mit.jwi.item.ISynset synset1, double shortestPath)Calculates the actual Shortest Path similarity.- Parameters:
synset1- , an input concept, used to retrieve the depth of the corresponding hierarchyshortestPath- , the length of the shortest path between two concepts- Returns:
- the Shortest Path similarity between two concepts
-
getSimilarityBetweenConcepts
public double getSimilarityBetweenConcepts(edu.mit.jwi.item.ISynset synset1, edu.mit.jwi.item.ISynset synset2)Computes the Shortest Path similarity between two concepts. It retrieves all possible hypernym paths for the two concepts and finds the shortest path between two concepts via their least common subsumer.- Parameters:
synset1- , the first input synsetsynset2- , the second input synset- Returns:
- the LCH similarity between synset1 and synset2
-
getRuntimeApproximation
public double getRuntimeApproximation(double mappingSize)
Description copied from interface:IMeasureReturns the runtime approximation of a measure.- Parameters:
mappingSize- , the mapping size returned by the measure- Returns:
- The runtime of the measure
-
getName
public String getName()
Description copied from interface:IMeasureReturns name of a measure.- Returns:
- Measure name as a string
-
-