Class ImplFreqVector
java.lang.Object
es.uam.eps.ir.relison.content.index.freq.impl.ImplFreqVector
- All Implemented Interfaces:
FreqVector,java.lang.Iterable<TermFreq>
public class ImplFreqVector extends java.lang.Object implements FreqVector
Implementation of a frequency vector
-
Field Summary
Fields Modifier and Type Field Description private it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<java.lang.String>vectorThe frequencies for the different terms. -
Constructor Summary
Constructors Constructor Description ImplFreqVector(java.lang.String text)Constructor. -
Method Summary
-
Field Details
-
vector
private final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<java.lang.String> vectorThe frequencies for the different terms.
-
-
Constructor Details
-
ImplFreqVector
public ImplFreqVector(java.lang.String text)Constructor. Builds a frequency vector from text.- Parameters:
text- the text.
-
-
Method Details
-
size
public long size()Description copied from interface:FreqVectorThe number of terms in the vector.- Specified by:
sizein interfaceFreqVector- Returns:
- the number of terms in the vector.
-
getFreq
public long getFreq(java.lang.String term)Description copied from interface:FreqVectorThe frequency of the term in the vector.- Specified by:
getFreqin interfaceFreqVector- Parameters:
term- the term.- Returns:
- the frequency of the term in the vector.
-
iterator
- Specified by:
iteratorin interfacejava.lang.Iterable<TermFreq>
-