CLucene - a full-featured, c++ search engine
API Documentation


lucene::search::FuzzyQuery Class Reference

#include <FuzzyQuery.h>

Inheritance diagram for lucene::search::FuzzyQuery:

lucene::search::MultiTermQuery lucene::search::Query

Public Member Functions

 FuzzyQuery (lucene::index::Term *term, float_t minimumSimilarity=defaultMinSimilarity, size_t prefixLength=0)
 Create a new FuzzyQuery that will match terms with a similarity of at least minimumSimilarity to term.
 ~FuzzyQuery ()
TCHAR * toString (const TCHAR *field) const
 Prints a user-readable version of this query.
const TCHAR * getQueryName () const
Queryclone () const
 Returns a clone of this query.
bool equals (Query *other) const
size_t hashCode () const
float_t getMinSimilarity () const
 Returns the minimum similarity that is required for this query to match.
size_t getPrefixLength () const
 Returns the prefix length, i.e.

Static Public Member Functions

static const TCHAR * getClassName ()

Static Public Attributes

static float_t defaultMinSimilarity
static int32_t defaultPrefixLength

Protected Member Functions

 FuzzyQuery (const FuzzyQuery &clone)
FilteredTermEnumgetEnum (lucene::index::IndexReader *reader)
 Construct the enumeration to be used, expanding the pattern term.

Constructor & Destructor Documentation

lucene::search::FuzzyQuery::FuzzyQuery ( const FuzzyQuery clone  )  [protected]

lucene::search::FuzzyQuery::FuzzyQuery ( lucene::index::Term term,
float_t  minimumSimilarity = defaultMinSimilarity,
size_t  prefixLength = 0 
)

Create a new FuzzyQuery that will match terms with a similarity of at least minimumSimilarity to term.

If a prefixLength > 0 is specified, a common prefix of that length is also required.

Parameters:
term the term to search for
minimumSimilarity a value between 0 and 1 to set the required similarity between the query term and the matching terms. For example, for a minimumSimilarity of 0.5 a term of the same length as the query term is considered similar to the query term if the edit distance between both terms is less than length(term)*0.5
prefixLength length of common (non-fuzzy) prefix
Exceptions:
IllegalArgumentException if minimumSimilarity is > 1 or < 0 or if prefixLength < 0 or > term.text().length().

lucene::search::FuzzyQuery::~FuzzyQuery (  ) 


Member Function Documentation

TCHAR* lucene::search::FuzzyQuery::toString ( const TCHAR *  field  )  const [virtual]

Prints a user-readable version of this query.

Reimplemented from lucene::search::MultiTermQuery.

static const TCHAR* lucene::search::FuzzyQuery::getClassName (  )  [static]

const TCHAR* lucene::search::FuzzyQuery::getQueryName (  )  const [virtual]

Implements lucene::search::Query.

Query* lucene::search::FuzzyQuery::clone (  )  const [virtual]

Returns a clone of this query.

Implements lucene::search::Query.

bool lucene::search::FuzzyQuery::equals ( Query other  )  const [virtual]

Implements lucene::search::Query.

size_t lucene::search::FuzzyQuery::hashCode (  )  const [virtual]

Implements lucene::search::Query.

float_t lucene::search::FuzzyQuery::getMinSimilarity (  )  const

Returns the minimum similarity that is required for this query to match.

Returns:
float value between 0.0 and 1.0

size_t lucene::search::FuzzyQuery::getPrefixLength (  )  const

Returns the prefix length, i.e.

the number of characters at the start of a term that must be identical (not fuzzy) to the query term if the query is to match that term.

FilteredTermEnum* lucene::search::FuzzyQuery::getEnum ( lucene::index::IndexReader reader  )  [protected, virtual]

Construct the enumeration to be used, expanding the pattern term.

Implements lucene::search::MultiTermQuery.


Field Documentation


The documentation for this class was generated from the following file:

clucene.sourceforge.net