|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.data.AbstractSOMLibTemplateVector
public abstract class AbstractSOMLibTemplateVector
This abstract implementation provides basic support for operating on a TemplateVector
. Sub-classes have to
implement constructors and methods to read and create a template vector, e.g. from a file or a database.
Field Summary | |
---|---|
protected int |
dim
The dimension of the template vector, i.e. |
protected Hashtable<String,TemplateVectorElement> |
elementMap
A mapping label --> attribute to allow fast access. |
protected TemplateVectorElement[] |
elements
The attributes of the template vector. |
protected int |
longestStringLength
|
protected int |
numInfo
|
protected int |
numVectors
|
protected String |
templateFileName
|
Fields inherited from interface at.tuwien.ifs.somtoolbox.data.TemplateVector |
---|
templateFileNameSuffix |
Constructor Summary | |
---|---|
AbstractSOMLibTemplateVector()
|
Method Summary | |
---|---|
boolean |
containsLabel(String label)
tests whether there is a feature/attribute with the given label |
int |
dim()
Gets the dimension. |
int |
getDocumentFrequency(String label)
|
TemplateVectorElement |
getElement(int index)
returns the template vector element for the feature/attribute at the given position |
TemplateVectorElement |
getElement(String label)
|
int |
getIndex(String label)
|
int |
getIndexOfFeature(String label)
Returns the numerical index of the feature with the given name. |
String |
getLabel(int i)
Gets the label at the given index. |
String[] |
getLabels()
Gets all the labels defined in this template vector. |
ArrayList<String> |
getLabelsAsList()
Gets all the labels defined in this template vector as a list. |
int |
getLongestStringLength()
calculates the length of the longest feature/attribute label |
double[] |
getTFxIDFVectorFromTerms(Hashtable<String,Integer> queryTerms)
|
void |
incNumVectors(int numVectors)
Increase the num-vectors counter, used e.g. |
int |
numinfo()
Returns how many columns the template vector contains, i.e. |
int |
numVectors()
Return how many vectors are in the input vector file associated with this template vector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int dim
protected int numInfo
protected int numVectors
protected String templateFileName
protected TemplateVectorElement[] elements
protected Hashtable<String,TemplateVectorElement> elementMap
protected int longestStringLength
Constructor Detail |
---|
public AbstractSOMLibTemplateVector()
Method Detail |
---|
public int dim()
TemplateVector
dim
in interface TemplateVector
public int numVectors()
TemplateVector
numVectors
in interface TemplateVector
public int numinfo()
TemplateVector
numinfo
in interface TemplateVector
public String getLabel(int i)
TemplateVector
getLabel
in interface TemplateVector
public String[] getLabels()
TemplateVector
getLabels
in interface TemplateVector
public ArrayList<String> getLabelsAsList()
TemplateVector
getLabelsAsList
in interface TemplateVector
public int getIndexOfFeature(String label)
TemplateVector
getIndexOfFeature
in interface TemplateVector
public int getIndex(String label)
public TemplateVectorElement getElement(String label)
public boolean containsLabel(String label)
TemplateVector
containsLabel
in interface TemplateVector
public int getDocumentFrequency(String label)
label
- the name of the term.
public double[] getTFxIDFVectorFromTerms(Hashtable<String,Integer> queryTerms)
queryTerms
- A map containing public TemplateVectorElement getElement(int index)
TemplateVector
getElement
in interface TemplateVector
public int getLongestStringLength()
TemplateVector
getLongestStringLength
in interface TemplateVector
public void incNumVectors(int numVectors)
TemplateVector
SOMLibInputMerger
.
incNumVectors
in interface TemplateVector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |