public class SemanticVector
extends java.lang.Object
| Constructor and Description |
|---|
SemanticVector(java.lang.String text)
Initialize the vector and set the text
|
SemanticVector(java.lang.String word,
float weight,
float[] coordinate)
Initialize the vector and set the text
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCoordinate(int index,
float data)
Add a specific coordinate
|
float[] |
getCoordinate() |
float |
getCoordinate(int dimension)
Get a specific coordinate
|
int |
getNumberOfWords() |
float |
getVectorLength()
Compute the length of the vector
|
float |
getWeight() |
java.lang.String |
getWord() |
void |
incrementNumberOfWords()
Increment the number of words, this vector is composed of
|
void |
setCoordinate(float[] coordinate) |
void |
setCoordinate(float coordinate,
int dimension)
Sets the coordinate for a specific dimension of this vector.
|
void |
setNumberOfWords(int numberOfWords)
Set the number of words, this vector is composed of.
|
void |
setWeight(float weight)
Set the weight of this word
|
void |
setWord(java.lang.String word)
Set the text of the vector
|
public SemanticVector(java.lang.String word,
float weight,
float[] coordinate)
word - the text of the vectorweight - the weight of the wordcoordinate - the coordinates of the vectorpublic SemanticVector(java.lang.String text)
text - public float[] getCoordinate()
public void setCoordinate(float[] coordinate)
coordinate - sets the coordinates for the vectorpublic java.lang.String getWord()
public void setWord(java.lang.String word)
word - the text to setpublic float getCoordinate(int dimension)
dimension - the index of the dimensionpublic void setCoordinate(float coordinate,
int dimension)
coordinate - the coordinatedimension - the index of the dimensionpublic void setWeight(float weight)
weight - the weight to setpublic float getWeight()
public void setNumberOfWords(int numberOfWords)
numberOfWords - the numberpublic int getNumberOfWords()
public void incrementNumberOfWords()
public void addCoordinate(int index,
float data)
index - the index of the dimensiondata - the value to addpublic float getVectorLength()