public class BasicLexiconEntry extends LexiconEntry implements BitIndexPointer
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicLexiconEntry.Factory
Factory for creating LexiconEntry objects
|
| Modifier and Type | Field and Description |
|---|---|
int |
n_t
the number of document that this entry occurs in
|
byte |
startBitOffset
the start bit offset of the entry in the inverted index
|
long |
startOffset
the start offset of the entry in the inverted index
|
int |
termId
the termid of this entry
|
int |
TF
the total number of occurrences of the term in the index
|
BIT_MASK, FILE_SHIFT, MAX_FILE_ID| Constructor and Description |
|---|
BasicLexiconEntry()
Create an empty LexiconEntry
|
BasicLexiconEntry(int tid,
int _n_t,
int _TF)
Create a lexicon entry with the following information.
|
BasicLexiconEntry(int tid,
int _n_t,
int _TF,
byte fileId,
BitFilePosition offset)
Create a lexicon entry with the following information.
|
BasicLexiconEntry(int tid,
int _n_t,
int _TF,
byte fileId,
long _startOffset,
byte _startBitOffset)
Create a lexicon entry with the following information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(EntryStatistics le)
increment this lexicon entry by another
|
int |
getDocumentFrequency()
The number of documents that the entry (term) occurred in
|
byte |
getFileNumber()
Returns the file number: 0-32
|
int |
getFrequency()
The frequency (total number of occurrences) of the entry (term).
|
int |
getNumberOfEntries()
Returns number of "things" that this pointer refers to
|
long |
getOffset()
Return the offset
|
byte |
getOffsetBits()
Return the offset bits
|
int |
getTermId()
The id of the term
|
String |
pointerToString()
Returns a textual representation of the pointer alone
|
void |
readFields(DataInput in) |
void |
setBitIndexPointer(BitIndexPointer pointer)
Update this pointer to reflect the same values as the specified
pointer
|
void |
setFileNumber(byte fileId)
Set the file number
|
void |
setNumberOfEntries(int n)
Set the number of "things that the pointer refers to
|
void |
setOffset(BitFilePosition pos)
Set the offset
|
void |
setOffset(long bytes,
byte bits)
Set the offset in bytes and bits
|
void |
setPointer(Pointer p)
Sets the pointer within this object to that represented by
the specified pointer
|
void |
setStatistics(int _n_t,
int _TF)
Set the term statistics, in particular, the number of documents that
this term appears in and the total number of occurrences of the term.
|
void |
setTermId(int newTermId)
Sets the ID for this term
|
void |
subtract(EntryStatistics le)
alter this lexicon entry to subtract another lexicon entry
|
String |
toString()
returns a string representation of this lexicon entry
|
void |
write(DataOutput out) |
equals, getWritableEntryStatistics, hashCodepublic int termId
public int n_t
public int TF
public long startOffset
public byte startBitOffset
public BasicLexiconEntry()
public BasicLexiconEntry(int tid,
int _n_t,
int _TF)
tid - the term id_n_t - the number of documents the term occurs in (document frequency)_TF - the total count of therm t in the collectionpublic BasicLexiconEntry(int tid,
int _n_t,
int _TF,
byte fileId,
long _startOffset,
byte _startBitOffset)
tid - _n_t - _TF - fileId - _startOffset - _startBitOffset - public BasicLexiconEntry(int tid,
int _n_t,
int _TF,
byte fileId,
BitFilePosition offset)
tid - _n_t - _TF - fileId - offset - public void setStatistics(int _n_t,
int _TF)
setStatistics in class LexiconEntrypublic void add(EntryStatistics le)
add in interface EntryStatisticspublic void subtract(EntryStatistics le)
subtract in interface EntryStatisticspublic String toString()
toString in class LexiconEntrypublic int getDocumentFrequency()
getDocumentFrequency in interface EntryStatisticspublic int getFrequency()
getFrequency in interface EntryStatisticspublic int getTermId()
getTermId in interface EntryStatisticspublic int getNumberOfEntries()
getNumberOfEntries in interface PointergetNumberOfEntries in class LexiconEntrypublic byte getOffsetBits()
getOffsetBits in interface BitFilePositionpublic long getOffset()
getOffset in interface BitFilePositionpublic byte getFileNumber()
getFileNumber in interface BitIndexPointerpublic void setFileNumber(byte fileId)
setFileNumber in interface BitIndexPointerpublic void setTermId(int newTermId)
setTermId in class LexiconEntrypublic void setOffset(long bytes,
byte bits)
setOffset in interface BitFilePositionpublic void setBitIndexPointer(BitIndexPointer pointer)
setBitIndexPointer in interface BitIndexPointerpointer - - pointer to use to set the offset, bit offset
and file Id parameters.public void setOffset(BitFilePosition pos)
setOffset in interface BitFilePositionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void setNumberOfEntries(int n)
setNumberOfEntries in interface PointersetNumberOfEntries in class LexiconEntrypublic String pointerToString()
pointerToString in interface PointerpointerToString in class LexiconEntrypublic void setPointer(Pointer p)
setPointer in interface PointersetPointer in class LexiconEntryp - other pointer to update the pointer in this objectTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow