Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

OmWeight Class Reference

Abstract base class for weighting schemes. More...

#include <omenquire.h>

Inheritance diagram for OmWeight:

Inheritance graph
[legend]
List of all members.

Public Methods

 OmWeight ()
virtual ~OmWeight ()
OmWeight * create (const Internal *internal_, om_doclength querysize_, om_termcount wqf_, om_termname tname_) const
 Create a new weight object of the same type as this and initialise it with the specified statistics. More...

virtual std::string name () const=0
 Name of the weighting scheme. More...

virtual std::string serialise () const=0
 Serialise object parameters into a string. More...

virtual OmWeight * OmWeight::unserialise (const std::string &s) const=0
 Create object given string serialisation returned by serialise(). More...

virtual om_weight get_sumpart (om_termcount wdf, om_doclength len) const=0
 Get a weight which is part of the sum over terms being performed. More...

virtual om_weight get_maxpart () const=0
 Gets the maximum value that get_sumpart() may return. More...

virtual om_weight get_sumextra (om_doclength len) const=0
 Get an extra weight for a document to add to the sum calculated over the query terms. More...

virtual om_weight get_maxextra () const=0
 Gets the maximum value that get_sumextra() may return. More...

virtual bool get_sumpart_needs_doclength () const
 return false if the weight object doesn't need doclength. More...


Protected Attributes

const Internal * internal
om_doclength querysize
om_termcount wqf
om_termname tname

Friends

class OmEnquire
class SocketServer

Detailed Description

Abstract base class for weighting schemes.


Member Function Documentation

OmWeight* OmWeight::create const Internal *    internal_,
om_doclength    querysize_,
om_termcount    wqf_,
om_termname    tname_
const [inline]
 

Create a new weight object of the same type as this and initialise it with the specified statistics.

You shouldn't call this method yourself - it's called by OmEnquire.

Parameters:
internal_  Object to ask for collection statistics.
querysize_  Query size.
wqf_  Within query frequency of term this object is associated with.
tname_  Term which this object is associated with.

virtual om_weight OmWeight::get_maxextra   const [pure virtual]
 

Gets the maximum value that get_sumextra() may return.

This is used in optimising searches.

Implemented in BoolWeight, BM25Weight, and TradWeight.

virtual om_weight OmWeight::get_maxpart   const [pure virtual]
 

Gets the maximum value that get_sumpart() may return.

This is used in optimising searches, by having the postlist tree decay appropriately when parts of it can have limited, or no, further effect.

Implemented in BoolWeight, BM25Weight, and TradWeight.

virtual om_weight OmWeight::get_sumextra om_doclength    len const [pure virtual]
 

Get an extra weight for a document to add to the sum calculated over the query terms.

This returns a weight for a given document, and is used by some weighting schemes to account for influence such as document length.

Parameters:
len  the (unnormalised) document length.

Implemented in BoolWeight, BM25Weight, and TradWeight.

virtual om_weight OmWeight::get_sumpart om_termcount    wdf,
om_doclength    len
const [pure virtual]
 

Get a weight which is part of the sum over terms being performed.

This returns a weight for a given term and document. These weights are summed to give a total weight for the document.

Parameters:
wdf  the within document frequency of the term.
len  the (unnormalised) document length.

Implemented in BoolWeight, BM25Weight, and TradWeight.

virtual bool OmWeight::get_sumpart_needs_doclength   const [inline, virtual]
 

return false if the weight object doesn't need doclength.

Reimplemented in BoolWeight, BM25Weight, and TradWeight.

virtual std::string OmWeight::name   const [pure virtual]
 

Name of the weighting scheme.

Implemented in BoolWeight, BM25Weight, and TradWeight.

virtual OmWeight* OmWeight::OmWeight::unserialise const std::string &    s const [pure virtual]
 

Create object given string serialisation returned by serialise().

virtual std::string OmWeight::serialise   const [pure virtual]
 

Serialise object parameters into a string.

Implemented in BoolWeight, BM25Weight, and TradWeight.


The documentation for this class was generated from the following file:
Documentation for Xapian (version 0.6.4).
Generated on 10 Apr 2003 by Doxygen 1.2.15.