public abstract class AEdgeCountingSemanticMeasure extends AMeasure implements IEdgeCountingSemanticMeasure
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ADJECTIVE_DEPTH |
protected static int |
ADVERB_DEPTH |
protected SemanticDictionary |
dictionary |
protected AIndex |
Indexer |
protected static int |
NOUN_DEPTH |
protected static int |
VERB_DEPTH |
| Constructor and Description |
|---|
AEdgeCountingSemanticMeasure(AIndex indexer) |
| Modifier and Type | Method and Description |
|---|---|
double |
checkSimilarity(HashMap<String,Double> similaritiesMap,
String sourceToken,
String targetToken)
Checks if a semantic similarity between two tokens has already been
calculated.
|
void |
close()
Closes and removes the semantic dictionary from memory
|
int |
getHierarchyDepth(int posNumber)
Retrieves the hierarchy depth for a given POS.
|
edu.mit.jwi.item.IIndexWord |
getIIndexWord(String str)
Retrieves the IIndexWord for a given input string
|
edu.mit.jwi.item.IWord |
getIWord(edu.mit.jwi.item.IWordID wordID)
Retrieves a IWord for a given IWordID
|
ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> |
getPaths(edu.mit.jwi.item.ISynset synset)
Retrieves a list of hypernym paths for a given concept, stored in an
index instance.
|
SemanticDictionary |
getSemanticDictionary() |
double |
getSimilarity(edu.mit.jwi.item.IIndexWord w1,
edu.mit.jwi.item.IIndexWord w2)
Calculates the semantic similarity between two IIndexWords.
|
double |
getSimilarity(Instance instance1,
Instance instance2,
String property1,
String property2)
Returns the similarity between two instances, given their corresponding
properties.
|
double |
getSimilarity(edu.mit.jwi.item.ISynset synset1,
edu.mit.jwi.item.ISynset synset2)
Calculates the semantic similarity between two concepts.
|
double |
getSimilarity(Object object1,
Object object2)
Returns the similarity between two objects.
|
edu.mit.jwi.item.ISynset |
getSynset(edu.mit.jwi.item.IWord iword)
Retrieves an ISynset for a given IWord
|
List<edu.mit.jwi.item.IWordID> |
getWordIDs(edu.mit.jwi.item.IIndexWord w)
Retrieves a list of IWordID for a given IIndexWord
|
void |
setDictionary(SemanticDictionary dict) |
String[] |
tokenize(String[] strings)
Tokenizes an array of strings
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSimilarityBetweenConceptsgetName, getRuntimeApproximation, getTypeprotected static final int NOUN_DEPTH
protected static final int VERB_DEPTH
protected static final int ADJECTIVE_DEPTH
protected static final int ADVERB_DEPTH
protected AIndex Indexer
protected SemanticDictionary dictionary
public AEdgeCountingSemanticMeasure(AIndex indexer)
public SemanticDictionary getSemanticDictionary()
public void setDictionary(SemanticDictionary dict)
public int getHierarchyDepth(int posNumber)
posNumber, - the input POS number idpublic edu.mit.jwi.item.IWord getIWord(edu.mit.jwi.item.IWordID wordID)
wordID, - the input IWordIDpublic edu.mit.jwi.item.ISynset getSynset(edu.mit.jwi.item.IWord iword)
iword, - the input IWordpublic List<edu.mit.jwi.item.IWordID> getWordIDs(edu.mit.jwi.item.IIndexWord w)
w, - the input IIndexWordpublic ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> getPaths(edu.mit.jwi.item.ISynset synset)
synset, - the input conceptpublic double getSimilarity(edu.mit.jwi.item.ISynset synset1,
edu.mit.jwi.item.ISynset synset2)
synset1, - the first input conceptsynset2, - the second input conceptpublic double getSimilarity(edu.mit.jwi.item.IIndexWord w1,
edu.mit.jwi.item.IIndexWord w2)
w1, - the first input IIndexWordw2, - the second input IIndexWordpublic String[] tokenize(String[] strings)
strings, - the input array of stringspublic double checkSimilarity(HashMap<String,Double> similaritiesMap, String sourceToken, String targetToken)
similaritiesMap, - the map that stores the semantic similarities between two
tokenssourceToken, - the source input tokentargetToken, - the target input tokenpublic double getSimilarity(Instance instance1, Instance instance2, String property1, String property2)
IMeasuregetSimilarity in interface IMeasurepublic void close()
public double getSimilarity(Object object1, Object object2)
IMeasuregetSimilarity in interface IMeasurepublic edu.mit.jwi.item.IIndexWord getIIndexWord(String str)
str, - the input stringCopyright © 2020. All rights reserved.