public class LSATools
extends java.lang.Object
| Constructor and Description |
|---|
LSATools() |
| Modifier and Type | Method and Description |
|---|---|
static float |
cosine(float[] x,
float[] y)
return the cosine between two vectors
|
static float |
getCosine(SemanticVector vector1,
SemanticVector vector2)
returns the cosine between two vectors using the cosine measure
|
static float |
getCosine(java.lang.String source,
java.lang.String target)
returns the cosine between two texts using the cosine measure
|
static float |
getDistance(SemanticVector vector1,
SemanticVector vector2)
Compute the euclidean distance between two vectors within the semantic space
|
static float |
getDistance(java.lang.String source,
java.lang.String target)
Compute the euclidean distance between two texts within the semantic space
|
static SemanticVector |
getVector(java.lang.String text)
returns a SemanticVector for an given text
|
static SemanticVector[] |
getVectors(java.lang.String[] texts)
returns an array of SemanticVector for a string array of texts
|
public static float getCosine(java.lang.String source,
java.lang.String target)
source - one texttarget - the other textpublic static float getCosine(SemanticVector vector1, SemanticVector vector2)
vector1 - the first vectorvector2 - the second vectorpublic static SemanticVector[] getVectors(java.lang.String[] texts)
texts - Array of Stringspublic static SemanticVector getVector(java.lang.String text)
text - Simple textpublic static float cosine(float[] x,
float[] y)
x - coordinates of vector 1y - coordinates of vector 2public static float getDistance(SemanticVector vector1, SemanticVector vector2)
vector1 - First vectorvector2 - Second vectorpublic static float getDistance(java.lang.String source,
java.lang.String target)
source - First texttarget - Second text