Class LuceneFreqVector

java.lang.Object
es.uam.eps.ir.relison.content.index.freq.lucene.LuceneFreqVector
All Implemented Interfaces:
FreqVector, java.lang.Iterable<TermFreq>

public class LuceneFreqVector
extends java.lang.Object
implements FreqVector
Lucene implementation of a term vector.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) LuceneFreqVectorIterator iterator
    Lucene iterator.
  • Constructor Summary

    Constructors 
    Constructor Description
    LuceneFreqVector​(org.apache.lucene.index.Terms terms)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    long getFreq​(java.lang.String term)
    The frequency of the term in the vector.
    java.util.Iterator<TermFreq> iterator()  
    long size()
    The number of terms in the vector.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

  • Constructor Details

    • LuceneFreqVector

      public LuceneFreqVector​(org.apache.lucene.index.Terms terms) throws java.io.IOException
      Constructor.
      Parameters:
      terms - the set of terms.
      Throws:
      java.io.IOException - if something fails while creating the iterator.
  • Method Details

    • size

      public long size()
      Description copied from interface: FreqVector
      The number of terms in the vector.
      Specified by:
      size in interface FreqVector
      Returns:
      the number of terms in the vector.
    • iterator

      public java.util.Iterator<TermFreq> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<TermFreq>
    • getFreq

      public long getFreq​(java.lang.String term) throws java.io.IOException
      Description copied from interface: FreqVector
      The frequency of the term in the vector.
      Specified by:
      getFreq in interface FreqVector
      Parameters:
      term - the term.
      Returns:
      the frequency of the term in the vector.
      Throws:
      java.io.IOException - if something fails while reading the vector.