Class MemoryLexiconEntry

    • Constructor Detail

      • MemoryLexiconEntry

        public MemoryLexiconEntry()
        Constructor.
      • MemoryLexiconEntry

        public MemoryLexiconEntry​(int termid)
        Constructor (termid).
      • MemoryLexiconEntry

        public MemoryLexiconEntry​(int df,
                                  int tf)
        Constructor (df, tf).
      • MemoryLexiconEntry

        public MemoryLexiconEntry​(int termid,
                                  int df,
                                  int tf)
        Constructor (termid, df, tf).
      • MemoryLexiconEntry

        public MemoryLexiconEntry​(int termid,
                                  int df,
                                  int tf,
                                  int maxtf)
    • Method Detail

      • getTermId

        public int getTermId()
        Return the id of the term.
        Specified by:
        getTermId in interface EntryStatistics
        Returns:
        the id of the term.
      • setTermId

        public void setTermId​(int termid)
        Set the term ID, the integer representation of the term in the index, e.g. as used in direct index posting structures.
        Specified by:
        setTermId in class LexiconEntry
      • getDocumentFrequency

        public int getDocumentFrequency()
        Return the number of documents that the term occurs in.
        Specified by:
        getDocumentFrequency in interface EntryStatistics
        Returns:
        the number of documents that the term occurs in.
      • getFrequency

        public int getFrequency()
        Return the frequency (total number of occurrences) of the term.
        Specified by:
        getFrequency in interface EntryStatistics
        Returns:
        the frequency (total number of occurrences) of the entry (term).
      • setStatistics

        public void setStatistics​(int df,
                                  int tf)
        Update the document frequency and term frequency
        Specified by:
        setStatistics in class LexiconEntry
      • add

        public void add​(EntryStatistics es)
        Increment the statistics of this object by that of another.
        Specified by:
        add in interface EntryStatistics
        Parameters:
        es - the other object whose statistics are used to increment the statistics of this object.
      • subtract

        public void subtract​(EntryStatistics es)
        Decrement the statistics of this object by that of another.
        Specified by:
        subtract in interface EntryStatistics
        Parameters:
        es - the other object whose statistics are used to decrement the statistics of this object.
      • 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.
      • setNumberOfEntries

        public void setNumberOfEntries​(int df)
        Update the number of entries in the pointer
        Specified by:
        setNumberOfEntries in interface Pointer
        Overrides:
        setNumberOfEntries in class LexiconEntry
        Parameters:
        df - the number of "things" that the pointer refers to.
      • getPointer

        public int getPointer()
        Get pointer value (termid).
        Specified by:
        getPointer in interface MemoryPointer
      • setPointer

        public void setPointer​(Pointer p)
        Update the pointer
        Specified by:
        setPointer in interface Pointer
        Overrides:
        setPointer in class LexiconEntry
        Parameters:
        p - other pointer to update the pointer in this object.
      • 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.
        Specified by:
        getMaxFrequencyInDocuments in interface EntryStatistics
        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.
        Specified by:
        setMaxFrequencyInDocuments in interface EntryStatistics
        Parameters:
        max - the maximum in-document term frequency of the term among all documents the terms appears in.
      • readFields

        public void readFields​(java.io.DataInput arg0)
                        throws java.io.IOException
        Not implemented.
        Specified by:
        readFields in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • write

        public void write​(java.io.DataOutput out)
                   throws java.io.IOException
        Not implemented.
        Specified by:
        write in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • setFrequency

        public void setFrequency​(int F)
        Description copied from interface: EntryStatistics
        Set the frequency (total number of occurrences) of the term.
        Specified by:
        setFrequency in interface EntryStatistics
        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.
        Specified by:
        setDocumentFrequency in interface EntryStatistics
        Parameters:
        nt - the number of documents that the term occurs in.