|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.retrieval.ArrayGroup com.sun.labs.minion.retrieval.ScoredGroup
public class ScoredGroup
A scored array group is one for which the documents have scores associated with them. When combined with another group via one of the combination operators, the scores for documents in both groups will be combined according to the dictates of the operator.
Nested Class Summary | |
---|---|
class |
ScoredGroup.ScoredDocIterator
A class for an iterator for this set. |
Nested classes/interfaces inherited from class com.sun.labs.minion.retrieval.ArrayGroup |
---|
ArrayGroup.DocIterator |
Field Summary | |
---|---|
protected boolean |
normalized
A flag indicating whether normalization has been performed on this group or not. |
protected float[] |
scores
The scores for the documents in the set. |
protected float |
sqw
The sum of the squared query weights for this group. |
protected float[] |
weights
The weights to be applied (eventually) to the scores. |
Fields inherited from class com.sun.labs.minion.retrieval.ArrayGroup |
---|
docs, logTag, part, pass, queryTerms, size, sm, width |
Constructor Summary | |
---|---|
protected |
ScoredGroup(ArrayGroup ag)
Creates a scored group from the given group. |
|
ScoredGroup(DiskPartition part,
double[] dist)
Creates a scored group from a set of euclidean distances between documents. |
|
ScoredGroup(DiskPartition part,
float[] scores)
|
|
ScoredGroup(DiskPartition part,
int[] docs,
float[] scores,
int l)
Creates a scored group from the given arrays. |
|
ScoredGroup(DiskPartition part,
int[] docs,
float[] scores,
int l,
float sqw)
Creates a scored group from the given arrays. |
|
ScoredGroup(int n)
|
|
ScoredGroup(int[] docs,
float[] scores,
int l)
Creates a scored group from the given arrays. |
|
ScoredGroup(PostingsIterator pi)
Creates an array group from the given postings iterator. |
|
ScoredGroup(PostingsIterator pi,
float qw)
Creates an array group from the given postings iterator. |
Method Summary | |
---|---|
void |
addDoc(int docID,
float score)
Adds a document to the group. |
ArrayGroup |
agIntersect(ArrayGroup ag)
Intersect a strict boolean group with this group. |
protected ArrayGroup |
agUnion(ArrayGroup ag)
Unions a statically type array group with this group. |
java.lang.Object |
clone()
Clones this group. |
ArrayGroup |
destructiveIntersect(PostingsIterator pi)
Intersects a postings iterator with this group, destructively. |
ArrayGroup |
destructiveMult(float m)
|
ScoredGroup |
discardBelow(float score)
Discards any entries in this scored group that are a score less than the value supplied |
boolean |
equals(java.lang.Object o)
Tests two scored groups for equality. |
float |
getScore(int i)
Get the score at a particular index |
ScoredGroup |
getScored()
Gets a scored group from this group, which just returns this group. |
ArrayGroup |
intersect(NegativeGroup ag)
Intersect a negative group with this group. |
ArrayGroup |
intersect(QueryTerm t)
Intersects the documents generated by the term with the ones in this group. |
ArrayGroup |
intersect(ScoredGroup ag)
Intersect a scored group with this group. |
ArrayGroup.DocIterator |
iterator()
Gets an iterator for the documents in this group. |
ArrayGroup |
mult(float m)
Applies a multiplier to an array group, returning a new group. |
ArrayGroup |
normalize()
Normalizes the scores by the document length. |
ArrayGroup |
normalize(int field)
Normalizes the scores by the document length. |
void |
removeDeleted(ReadableBuffer del)
Removes deleted documents from the results set, modifying the set in the process. |
void |
retain(int[] ids)
Retain only the documents with the given ids |
void |
setNormalized()
|
void |
setScore(int i,
float score)
Sets the score at a particular index |
ScoredGroup |
sort()
Sorts this group by score, returning a sorted version. |
ScoredGroup |
sort(boolean destructive)
Sorts this group by score, returning a sorted version. |
java.lang.String |
toString()
|
java.lang.String |
toString(int t)
|
ArrayGroup |
union(ScoredGroup ag)
Union a scored group with this group. |
Methods inherited from class com.sun.labs.minion.retrieval.ArrayGroup |
---|
addDoc, addPassage, addPassage, destructiveIntersect, getDoc, getDocs, getNegative, getPartition, getPassages, getSize, getStrict, init, init, intersect, removeDeleted, resize, setDoc, setPartition, setScoreModifier, setSize, union, union, union, union |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected float[] scores
protected float[] weights
protected float sqw
protected boolean normalized
Constructor Detail |
---|
public ScoredGroup(int n)
public ScoredGroup(DiskPartition part, float[] scores)
protected ScoredGroup(ArrayGroup ag)
public ScoredGroup(PostingsIterator pi)
public ScoredGroup(PostingsIterator pi, float qw)
pi
- the postings iterator from which we will get the documents
and scores for the group.qw
- the weight associated with the query term that produced
these postings.public ScoredGroup(int[] docs, float[] scores, int l)
public ScoredGroup(DiskPartition part, int[] docs, float[] scores, int l)
public ScoredGroup(DiskPartition part, int[] docs, float[] scores, int l, float sqw)
public ScoredGroup(DiskPartition part, double[] dist)
We will leave it up to the application to normalize such scores.
part
- the partition from which the distances were calculated.dist
- an array of doubles containing the distances between documents.Method Detail |
---|
public ScoredGroup getScored()
getScored
in class ArrayGroup
public float getScore(int i)
public void addDoc(int docID, float score)
public void setScore(int i, float score)
public ArrayGroup intersect(QueryTerm t)
intersect
in class ArrayGroup
t
- The term to intersect with the current set.
public void removeDeleted(ReadableBuffer del)
removeDeleted
in class ArrayGroup
public void retain(int[] ids)
ArrayGroup
retain
in class ArrayGroup
ids
- document ids to keeppublic ArrayGroup normalize()
normalize
in class ArrayGroup
public ArrayGroup normalize(int field)
field
- the ID of a vectored field whose length we should use. If
this is -1, then the length computed across all vectored fields is used.
If this is 0, then the length for the data not in any explicit field is
used. If this is not 0, then the length of that field is used. Note if
this ID is not for a vectored field, then a default length of 1 will be
used!
public void setNormalized()
public ArrayGroup destructiveIntersect(PostingsIterator pi)
destructiveIntersect
in class ArrayGroup
public ScoredGroup discardBelow(float score)
score
- the score below which to discard values
protected ArrayGroup agUnion(ArrayGroup ag)
ArrayGroup
to do this.
agUnion
in class ArrayGroup
public ArrayGroup union(ScoredGroup ag)
union
in class ArrayGroup
ag
- The scored group to union with this group.
ScoredGroup
is returned.public ArrayGroup agIntersect(ArrayGroup ag)
agIntersect
in class ArrayGroup
ag
- The scored group to intersect with this group.
ScoredGroup
is returned.public ArrayGroup intersect(ScoredGroup ag)
intersect
in class ArrayGroup
ag
- The scored group to intersect with this group.
ScoredGroup
will be returned.public ArrayGroup intersect(NegativeGroup ag)
intersect
in class ArrayGroup
ag
- The scored group to intersect with this group.
public ArrayGroup mult(float m)
mult
in class ArrayGroup
m
- The multiplier to apply.
public ArrayGroup destructiveMult(float m)
public ArrayGroup.DocIterator iterator()
iterator
in class ArrayGroup
public ScoredGroup sort()
public ScoredGroup sort(boolean destructive)
destructive
- if true
, this group is modifiedpublic java.lang.Object clone()
clone
in class ArrayGroup
public boolean equals(java.lang.Object o)
equals
in class ArrayGroup
true
if the groups contain the same documents,
false
otherwise.public java.lang.String toString()
toString
in class ArrayGroup
public java.lang.String toString(int t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |