|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.labs.minion.classification.FeaturePostings
public class FeaturePostings
An implementation of Postings that we can use to store classifier features. The postings will store the IDs for the features as well as encoding the other information about the features.
| Nested Class Summary | |
|---|---|
class |
FeaturePostings.Featurator
|
| Field Summary | |
|---|---|
protected int |
dataStart
The offset of the start of the actual data in our ino buffer. |
protected Feature[] |
feats
An array of the features added. |
protected Buffer |
info
A buffer holding feature info. |
protected Buffer |
ino
A buffer holding feature IDs and offsets into the info buffer. |
protected int |
lastID
The last ID that we hold. |
protected int |
lastOff
The last info offset that we hold. |
protected static java.lang.String |
logTag
|
protected int |
nIDs
The number of features that we hold. |
| Constructor Summary | |
|---|---|
FeaturePostings()
Creates a set of postings suitable for indexing time. |
|
FeaturePostings(ReadableBuffer ino,
ReadableBuffer info)
Creates a set of postings suitable for querying time. |
|
| Method Summary | |
|---|---|
void |
add(Occurrence o)
Adds an occurrence to the postings list. |
void |
append(Postings p,
int start)
Appends another set of postings to this one. |
void |
append(Postings p,
int start,
int[] idMap)
Appends another set of postings to this one, removing any data associated with deleted documents. |
void |
finish()
Finishes any ongoing encoding and prepares for the data to be dumped. |
WriteableBuffer[] |
getBuffers()
Gets a number of Buffers whose contents represent the
postings. |
int |
getLastID()
Gets the last ID in the postings list. |
int |
getMaxFDT()
Gets the maximum fdt value for these postings, which is just 1, since we're using real-valued features. |
int |
getN()
Gets the number of IDs in the postings list. |
long |
getTotalOccurrences()
Gets the total number of occurrences for these postings, which is just the number of features encoded. |
boolean |
hasFieldInformation()
|
boolean |
hasPositionInformation()
|
PostingsIterator |
iterator(PostingsIteratorFeatures features)
Gets an iterator for the postings. |
void |
remap(int[] idMap)
Remaps the IDs in the features in these postings, resulting in the encoding of the IDs and feature information to the buffers. |
void |
setSkipSize(int size)
Sets the skip size used for building the skip table. |
int |
size()
Gets the size of the postings, in bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Feature[] feats
protected int nIDs
protected int lastID
protected int lastOff
protected int dataStart
protected Buffer ino
protected Buffer info
protected static java.lang.String logTag
| Constructor Detail |
|---|
public FeaturePostings()
public FeaturePostings(ReadableBuffer ino,
ReadableBuffer info)
| Method Detail |
|---|
public void setSkipSize(int size)
setSkipSize in interface Postingspublic long getTotalOccurrences()
getTotalOccurrences in interface Postingspublic int getMaxFDT()
getMaxFDT in interface Postingspublic void add(Occurrence o)
Feature.
add in interface Postingso - The occurrence.public int getN()
getN in interface Postingspublic int getLastID()
Postings
getLastID in interface Postingspublic void finish()
finish in interface Postingspublic int size()
size in interface Postingspublic WriteableBuffer[] getBuffers()
Buffers whose contents represent the
postings. These buffers can be written to disk.
This method must ensure that all of the data used by the entry is properly handled by the time that the method returns. This method will be called by a dictionary when it is ready to dump the postings data to a stream.
getBuffers in interface PostingsBuffers containing the postings
data. All of the data in these buffers must be written to the
postings file!public void remap(int[] idMap)
remap in interface PostingsidMap - a map from the IDs currently in use in the postings to
new IDs.
public void append(Postings p,
int start)
append in interface Postingsp - The postings to append. Implementers can safely assume
that the postings being passed in are of the same class as the
implementing class.start - The new starting document ID for the partition
that the entry was drawn from.
public void append(Postings p,
int start,
int[] idMap)
append in interface Postingsp - The postings to append. Implementers can safely assume
that the postings being passed in are of the same class as the
implementing class.start - The new starting document ID for the partition
that the entry was drawn from.idMap - A map from old IDs in the given postings to new IDs
with gaps removed for deleted data. If this is null, then there are
no deleted documents.public PostingsIterator iterator(PostingsIteratorFeatures features)
iterator in interface Postingsfeatures - A set of features that the iterator must support.
null will be returned.public boolean hasPositionInformation()
public boolean hasFieldInformation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||