|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.structures.LexiconEntry org.terrier.structures.BasicLexiconEntry
public class BasicLexiconEntry
Contains all the information about one entry in the Lexicon. Created to make thread-safe lookups in the Lexicon easier.
Nested Class Summary | |
---|---|
static class |
BasicLexiconEntry.Factory
Factory for creating LexiconEntry objects |
Field Summary | |
---|---|
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 |
Fields inherited from interface org.terrier.structures.BitIndexPointer |
---|
BIT_MASK, FILE_SHIFT, MAX_FILE_ID |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
java.lang.String |
pointerToString()
Returns a textual representation of the pointer alone |
void |
readFields(java.io.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 |
java.lang.String |
toString()
returns a string representation of this lexicon entry |
void |
write(java.io.DataOutput out)
|
Methods inherited from class org.terrier.structures.LexiconEntry |
---|
equals, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int termId
public int n_t
public int TF
public long startOffset
public byte startBitOffset
Constructor Detail |
---|
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
- Method Detail |
---|
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 java.lang.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
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(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void setNumberOfEntries(int n)
setNumberOfEntries
in interface Pointer
public java.lang.String pointerToString()
pointerToString
in interface Pointer
public void setPointer(Pointer p)
setPointer
in interface Pointer
p
- other pointer to update the pointer in this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |