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, hashCode
public 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 LexiconEntry
public void add(EntryStatistics le)
add
in interface EntryStatistics
public void subtract(EntryStatistics le)
subtract
in interface EntryStatistics
public String toString()
toString
in class LexiconEntry
public int getDocumentFrequency()
getDocumentFrequency
in interface EntryStatistics
public int getFrequency()
getFrequency
in interface EntryStatistics
public int getTermId()
getTermId
in interface EntryStatistics
public int getNumberOfEntries()
getNumberOfEntries
in interface Pointer
getNumberOfEntries
in class LexiconEntry
public byte getOffsetBits()
getOffsetBits
in interface BitFilePosition
public long getOffset()
getOffset
in interface BitFilePosition
public byte getFileNumber()
getFileNumber
in interface BitIndexPointer
public void setFileNumber(byte fileId)
setFileNumber
in interface BitIndexPointer
public void setTermId(int newTermId)
setTermId
in class LexiconEntry
public void setOffset(long bytes, byte bits)
setOffset
in interface BitFilePosition
public void setBitIndexPointer(BitIndexPointer pointer)
setBitIndexPointer
in interface BitIndexPointer
pointer
- - pointer to use to set the offset, bit offset
and file Id parameters.public void setOffset(BitFilePosition pos)
setOffset
in interface BitFilePosition
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void setNumberOfEntries(int n)
setNumberOfEntries
in interface Pointer
setNumberOfEntries
in class LexiconEntry
public String pointerToString()
pointerToString
in interface Pointer
pointerToString
in class LexiconEntry
public void setPointer(Pointer p)
setPointer
in interface Pointer
setPointer
in class LexiconEntry
p
- other pointer to update the pointer in this objectTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow