Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

lemur::retrieval::QueryNode Class Reference

Base class for all structured query operators. More...

#include <QueryNode.hpp>

Inheritance diagram for lemur::retrieval::QueryNode:

lemur::retrieval::BeliefNode lemur::retrieval::ProxNode lemur::retrieval::AndQnode lemur::retrieval::BandNotQnode lemur::retrieval::BandQnode lemur::retrieval::FiltRejQnode lemur::retrieval::FiltReqQnode lemur::retrieval::MaxQnode lemur::retrieval::NotQnode lemur::retrieval::OrQnode lemur::retrieval::SumQnode lemur::retrieval::WsumQnode lemur::retrieval::OdnQNode lemur::retrieval::PassageQNode lemur::retrieval::SynQNode lemur::retrieval::TermQnode lemur::retrieval::UwnQNode List of all members.

Public Member Functions

 QueryNode (int id, double weight)
 New QueryNode with given id and weight.

 QueryNode ()
 New QueryNode with default id (0) and weight (1).

 QueryNode (double weight, double dWeight=0)
 New QueryNode with given weight and default id (0).

virtual ~QueryNode ()
 clean up internal data.

const QnListchildren () const
 the children of this node

void setChildren (QnList *cl)
 set the children of this node

int id () const
 the node's id

double weight () const
 the weight of this node.

void setWeight (double wt)
void setEntries (int cnt)
virtual void copyDocList (int len, int tf, const lemur::api::DocInfoList *dl, int dc)
 Copy the DocInfoList for a given node.

virtual void updateDocList (int numDocs)=0
 update doc list from children's doc lists.

virtual double eval (const lemur::api::DocumentRep *dRep) const =0
 evaluate the node on the given document, returning a score.

bool isProxNode () const
 Does this node have a proxList?

void startProxIteration () const
 Iteration through a node's prox lists.

bool hasMoreProx () const
 Any entries left in the list?

bool nextProxItem () const
 advance to next element in list. return false if empty.

bool nextProxItem (lemur::api::DOCID_T did) const

Public Attributes

int dCnt
 number of documents this node matched

bool * dList
 array of bool matched docs indexed by docid

lemur::api::DOCID_T nextDoc
 the next document this node matched.

ProxInfoproxList
 This node's ProxInfo list.


Protected Member Functions

void transformPassageOps ()
 flatten children of a node into weighted prox entries.

void unionDocList (int numDocs)
 Union the DocInfoLists of a given node.

void intersectDocList (int numDocs)
 Intersect the DocInfoLists of a given node.


Protected Attributes

QnListch
 This node's children list.

int entries
 Number of children in ch.

int it
 query node id

double w
 query node weight

double dw
 The default score.


Detailed Description

Base class for all structured query operators.

A query node is assumed to have a list of children, an id, a weight (default 1) and an eval function which will be defined by its subclasses.


Constructor & Destructor Documentation

lemur::retrieval::QueryNode::QueryNode int  id,
double  weight
[inline]
 

New QueryNode with given id and weight.

lemur::retrieval::QueryNode::QueryNode  )  [inline]
 

New QueryNode with default id (0) and weight (1).

lemur::retrieval::QueryNode::QueryNode double  weight,
double  dWeight = 0
[inline]
 

New QueryNode with given weight and default id (0).

virtual lemur::retrieval::QueryNode::~QueryNode  )  [inline, virtual]
 

clean up internal data.


Member Function Documentation

const QnList* lemur::retrieval::QueryNode::children  )  const [inline]
 

the children of this node

virtual void lemur::retrieval::QueryNode::copyDocList int  len,
int  tf,
const lemur::api::DocInfoList dl,
int  dc
[inline, virtual]
 

Copy the DocInfoList for a given node.

Reimplemented in lemur::retrieval::TermQnode.

virtual double lemur::retrieval::QueryNode::eval const lemur::api::DocumentRep dRep  )  const [pure virtual]
 

evaluate the node on the given document, returning a score.

Implemented in lemur::retrieval::ProxNode, lemur::retrieval::SumQnode, lemur::retrieval::WsumQnode, lemur::retrieval::AndQnode, lemur::retrieval::OrQnode, lemur::retrieval::NotQnode, lemur::retrieval::MaxQnode, lemur::retrieval::BandQnode, lemur::retrieval::BandNotQnode, lemur::retrieval::FiltRejQnode, lemur::retrieval::FiltReqQnode, lemur::retrieval::TermQnode, and lemur::retrieval::PassageQNode.

bool lemur::retrieval::QueryNode::hasMoreProx  )  const [inline]
 

Any entries left in the list?

int lemur::retrieval::QueryNode::id  )  const [inline]
 

the node's id

void lemur::retrieval::QueryNode::intersectDocList int  numDocs  )  [protected]
 

Intersect the DocInfoLists of a given node.

this should iterate over the sets of prox lists pairwise intersect (or clever).

bool lemur::retrieval::QueryNode::isProxNode  )  const [inline]
 

Does this node have a proxList?

bool lemur::retrieval::QueryNode::nextProxItem lemur::api::DOCID_T  did  )  const [inline]
 

advance to element with id did, or to next element beyond if did is not found. Return true if found, false if not.

bool lemur::retrieval::QueryNode::nextProxItem  )  const [inline]
 

advance to next element in list. return false if empty.

void lemur::retrieval::QueryNode::setChildren QnList cl  )  [inline]
 

set the children of this node

void lemur::retrieval::QueryNode::setEntries int  cnt  )  [inline]
 

void lemur::retrieval::QueryNode::setWeight double  wt  )  [inline]
 

void lemur::retrieval::QueryNode::startProxIteration  )  const [inline]
 

Iteration through a node's prox lists.

void lemur::retrieval::QueryNode::transformPassageOps  )  [protected]
 

flatten children of a node into weighted prox entries.

flatten children of a node into weighted proximity entries. removes all belief operators.

void lemur::retrieval::QueryNode::unionDocList int  numDocs  )  [protected]
 

Union the DocInfoLists of a given node.

first elt

first elt

first elt

virtual void lemur::retrieval::QueryNode::updateDocList int  numDocs  )  [pure virtual]
 

update doc list from children's doc lists.

Implemented in lemur::retrieval::BeliefNode, lemur::retrieval::ProxNode, lemur::retrieval::BandQnode, lemur::retrieval::FiltReqQnode, lemur::retrieval::OdnQNode, lemur::retrieval::UwnQNode, lemur::retrieval::PassageQNode, and lemur::retrieval::SynQNode.

double lemur::retrieval::QueryNode::weight  )  const [inline]
 

the weight of this node.


Member Data Documentation

QnList* lemur::retrieval::QueryNode::ch [protected]
 

This node's children list.

int lemur::retrieval::QueryNode::dCnt
 

number of documents this node matched

bool* lemur::retrieval::QueryNode::dList
 

array of bool matched docs indexed by docid

double lemur::retrieval::QueryNode::dw [protected]
 

The default score.

int lemur::retrieval::QueryNode::entries [protected]
 

Number of children in ch.

int lemur::retrieval::QueryNode::it [protected]
 

query node id

lemur::api::DOCID_T lemur::retrieval::QueryNode::nextDoc [mutable]
 

the next document this node matched.

ProxInfo* lemur::retrieval::QueryNode::proxList
 

This node's ProxInfo list.

double lemur::retrieval::QueryNode::w [protected]
 

query node weight


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:06 2010 for Lemur by doxygen 1.3.4