QrySop
index
/bos/usr0/callan/Classes/11-642/2023-F/QrySop.py

QrySop is the root class of all query operators that use a
retrieval model to determine whether a query matches a document and to
calculate a score for the document.  This class has two main purposes.
First, it allows query operators to easily recognize any nested query
operator that returns a document scores (e.g., #AND (a #OR(b c)).
Second, it is a place to store data structures and methods that are
common to all query operators that calculate document scores.

 
Classes
       
Qry.Qry(builtins.object)
QrySop

 
class QrySop(Qry.Qry)
    
Method resolution order:
QrySop
Qry.Qry
builtins.object

Methods defined here:
__init__(self)
Initialize self.  See help(type(self)) for accurate signature.
getDefaultScore(retrievalModel, docid)
Get a score that indicates how well the query matches the specified
document (which is assumed to not contain the query term(s)).
 
retrievalModel: retrieval model parameters
docid: an internal document id
 
Returns a score that indicates how well the query matches the document.
 
throws IOException: Error accessing the Lucene index
getScore(self, retrievalModel)
Get a score for the document that docIteratorHasMatch matched.
 
retrievalModel: retrieval model parameters
 
Returns the document score.
 
throws IOException: Error accessing the Lucene index
initialize(self, retrievalModel)
Initialize the query operator (and its arguments), including any
internal iterators.  If the query operator is of type QryIop, it
is fully evaluated, and the results are stored in an internal
inverted list that may be accessed via the internal iterator.
 
retrievalModel: A retrieval model that guides initialization
 
throws IOException: Error accessing the Lucene index.

Data and other attributes defined here:
sys = <module 'sys' (built-in)>

Methods inherited from Qry.Qry:
__str__(self)
Get a string version of this query operator.  This is a generic
method that works for most query operators.  However, some query
operators (e.g., #NEAR/n or #WEIGHT) may need to override this
method with something more specific.
 
Returns the string version of this query operator.
appendArg(self, q)
Append an argument to the list of query operator arguments.  
 
q: The query argument (query operator) to append.
 
throws: IllegalArgumentException q is an invalid argument
delArg(self, i)
Delete the i'th argument from the list of query operator arguments.
docIteratorAdvancePast(self, docid)
Advance the internal document iterator beyond the specified
document.
 
docid: An internal document id.
docIteratorAdvanceTo(self, docid)
Advance the internal document iterator to the specified
document, or beyond if it doesn't.
 
docid: An internal document id.
docIteratorClearMatchCache(self)
Clear the docIterator's matching docid cache.  The cache should
be cleared whenever a docIterator is advanced.
docIteratorGetMatch(self)
Return the id of the document that the iterator points to now.
Use docIteratorHasMatch to determine whether the iterator
currently points to a document.  If the iterator doesn't point
to a document, an invalid document id is returned.
 
Returns the internal id of the current document.
docIteratorHasMatch(self, r)
Indicate whether the query has a match.        
r: The retrieval model that determines what is a match
 
Returns True if the query matches, otherwise False.
docIteratorHasMatchAll(self, r)
An instantiation of docIteratorHasMatch that is true if the
query has a document that matches all query arguments; some
subclasses may choose to use this implementation.  
 
r: The retrieval model that determines what is a match.
 
Returns True if the query matches, otherwise False.
docIteratorHasMatchCache(self)
Returns True if a match is cached, otherwise False.
docIteratorHasMatchFirst(self, r)
An instantiation of docIteratorHasMatch that is true if the
query has a document that matches the first query argument;
some subclasses may choose to use this implementation.
 
r: The retrieval model that determines what is a match.
Returns True if the query matches, otherwise False.
docIteratorHasMatchMin(self, r)
An instantiation of docIteratorHasMatch that is true if the
query has a document that matches at least one query argument;
the match is the smallest docid to match; some subclasses may
choose to use this implementation.
 
r: The retrieval model that determines what is a match
Returns True if the query matches, otherwise False.
docIteratorSetMatchCache(self, docid)
Set the matching docid cache.
 
docid: The internal document id to store in the cache.
getDisplayName(self)
Every operator has a display name that can be used by
toString for debugging or other user feedback.  
 
Returns the query operator's display name.
setDisplayName(self, name)
Every operator must have a display name that can be used by
toString for debugging or other user feedback.  
 
name: The query operator's display name

Data descriptors inherited from Qry.Qry:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from Qry.Qry:
INVALID_DOCID = -1