Class MultiLexiconEntry

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.hadoop.io.Writable, EntryStatistics, Pointer

    public class MultiLexiconEntry
    extends LexiconEntry
    A Lexicon entry that spans multiple index shards. It wraps around multiple lexicon entries from different index shards.
    Since:
    4.0
    Author:
    Richard McCreadie, Stuart Mackie
    See Also:
    Serialized Form
    • Constructor Detail

      • MultiLexiconEntry

        public MultiLexiconEntry​(LexiconEntry[] le,
                                 int hashcode)
        Constructor.
    • Method Detail

      • getChildren

        public LexiconEntry[] getChildren()
        Return LexiconEntry's.
      • getFrequency

        public int getFrequency()
        Return the frequency (total number of occurrences) of the term.
        Returns:
        the frequency (total number of occurrences) of the entry (term).
      • getDocumentFrequency

        public int getDocumentFrequency()
        Return the number of documents that the term occurs in.
        Returns:
        the number of documents that the term occurs in.
      • getNumberOfEntries

        public int getNumberOfEntries()
        Pointer implementation: how many entries in the inverted index. Usually the same as getDocumentFrequency().
        Specified by:
        getNumberOfEntries in interface Pointer
        Overrides:
        getNumberOfEntries in class LexiconEntry
        Returns:
        the number of "things" that this pointer refers to.
      • getTermId

        public int getTermId()
        Not implemented.
        Returns:
        the id of the term.
      • add

        public void add​(EntryStatistics e)
        Not implemented.
        Parameters:
        e - the other object whose statistics are used to increment the statistics of this object.
      • subtract

        public void subtract​(EntryStatistics e)
        Not implemented.
        Parameters:
        e - the other object whose statistics are used to decrement the statistics of this object.
      • setPointer

        public void setPointer​(Pointer p)
        Not implemented.
        Specified by:
        setPointer in interface Pointer
        Overrides:
        setPointer in class LexiconEntry
        Parameters:
        p - other pointer to update the pointer in this object.
      • readFields

        public void readFields​(java.io.DataInput arg0)
                        throws java.io.IOException
        Not implemented.
        Throws:
        java.io.IOException
      • write

        public void write​(java.io.DataOutput arg0)
                   throws java.io.IOException
        Not implemented.
        Throws:
        java.io.IOException
      • setTermId

        public void setTermId​(int newTermId)
        Not implemented.
        Specified by:
        setTermId in class LexiconEntry
      • setStatistics

        public void setStatistics​(int n_t,
                                  int TF)
        Not implemented.
        Specified by:
        setStatistics in class LexiconEntry
      • getMaxFrequencyInDocuments

        public int getMaxFrequencyInDocuments()
        Description copied from interface: EntryStatistics
        Return the maximum in-document term frequency of the term among all documents the terms appears in.
        Returns:
        the maximum in-document term frequency of the term among all documents the terms appears in.
      • setMaxFrequencyInDocuments

        public void setMaxFrequencyInDocuments​(int max)
        Description copied from interface: EntryStatistics
        Set the maximum in-document term frequency of the term among all documents the terms appears in.
        Parameters:
        max - the maximum in-document term frequency of the term among all documents the terms appears in.
      • setFrequency

        public void setFrequency​(int F)
        Description copied from interface: EntryStatistics
        Set the frequency (total number of occurrences) of the term.
        Parameters:
        F - the frequency (total number of occurrences) of the entry (term).
      • setDocumentFrequency

        public void setDocumentFrequency​(int nt)
        Description copied from interface: EntryStatistics
        Set the number of documents that the term occurs in.
        Parameters:
        nt - the number of documents that the term occurs in.