public class WNsim extends Object
| Constructor and Description |
|---|
WNsim() |
| Modifier and Type | Method and Description |
|---|---|
static void |
calcMaxFreqs() |
static HashMap<String,Integer> |
computeSubsumingFreq(HashSet<String> childRels,
HashSet<String> parentRels) |
static int |
computeSubsumingFreq2(HashSet<String> childRels,
HashSet<String> parentRels) |
static int |
computeSubsumingFreq2(String synset,
HashSet<String> childRels,
HashSet<String> parentRels) |
static float |
computeSynsetSim(String s1,
String s2)
Compute similarity of two synsets.
|
static float |
computeWordSim(String s1,
String s2,
boolean allSynsets)
Compute similarity of two words as the maximum similarity among
their possible synsets.
|
static double |
correlation(HashMap<String,Float> x,
HashMap<String,Float> y)
determine the sample correlation coefficient
|
static void |
createIndexes() |
static float |
deviation(HashMap<String,Float> x,
HashMap<String,Float> y,
float meanx,
float meany) |
static HashSet<String> |
getChildList(String s) |
static int |
getIndex(String s) |
static HashMap<String,Integer> |
getSubsumingFreq() |
static void |
main(String[] args)
A main method, used only for testing.
|
static float |
maxCommonSynsetOverlap(String s1,
String s2) |
static float |
mean(HashMap<String,Float> x) |
static HashMap<String,HashMap<String,Float>> |
readTestFile(String filename,
String regex,
boolean removePOS)
Read a space-delimited file of word pairs and their similarity
rating.
|
static BitSet |
setBits(String s) |
static float |
sqDeviation(HashMap<String,Float> x,
float mean) |
static int |
synsetOverlap(String s1,
String s2)
Compute the number of child synsets shared by the two synsets
|
static float |
synsetPercentOverlap(String s1,
String s2)
Compute the percentage of child synsets of the first synset
shared by the second synset
|
static void |
test() |
public static void calcMaxFreqs()
public static HashMap<String,Integer> computeSubsumingFreq(HashSet<String> childRels, HashSet<String> parentRels)
public static int computeSubsumingFreq2(HashSet<String> childRels, HashSet<String> parentRels)
public static int computeSubsumingFreq2(String synset, HashSet<String> childRels, HashSet<String> parentRels)
public static float computeSynsetSim(String s1, String s2)
public static float computeWordSim(String s1, String s2, boolean allSynsets)
allSynsets - determines whether to take the best fit from
all possible synsets for the words, or just
to compare the most frequent synsets for each
wordpublic static HashMap<String,HashMap<String,Float>> readTestFile(String filename, String regex, boolean removePOS)
public static float deviation(HashMap<String,Float> x, HashMap<String,Float> y, float meanx, float meany)
public static double correlation(HashMap<String,Float> x, HashMap<String,Float> y)
public static HashSet<String> getChildList(String s)
public static int getIndex(String s)
s - is a POS-prefixed synsetpublic static BitSet setBits(String s)
s - is a POS-prefixed synsetpublic static void createIndexes()
public static int synsetOverlap(String s1, String s2)
public static float synsetPercentOverlap(String s1, String s2)
public static void test()
public static void main(String[] args)
Copyright © 2015. All rights reserved.