Term Class Reference

Class used to pass information about a token from lexer to parser. More...

Collaboration diagram for Term:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Term (const string &name_, termpos pos_)
 Term (const string &name_)
 Term (const string &name_, const PrefixInfo *prefix_info_)
 Term (termpos pos_)
 Term (State *state_, const string &name_, const PrefixInfo *prefix_info_, const string &unstemmed_, QueryParser::stem_strategy stem_=QueryParser::STEM_NONE, termpos pos_=0)
 Term (valueno slot, const string &a, const string &b)
string make_term (const string &prefix) const
void need_positions ()
termpos get_termpos () const
filter_group_id get_filter_group_id () const
Queryas_wildcarded_query (State *state) const
Queryas_partial_query (State *state_) const
 Build a query for a term at the very end of the query string when FLAG_PARTIAL is in use.
Queryas_cjk_query () const
 Build a query for a string of CJK characters.
void as_positional_cjk_term (Terms *terms) const
 Handle a CJK character string in a positional context.
Query as_value_range_query () const
 Value range query.
Query get_query () const
Query get_query_with_synonyms () const
Query get_query_with_auto_synonyms () const

Public Attributes

string name
const PrefixInfoprefix_info
string unstemmed
QueryParser::stem_strategy stem
termpos pos

Private Attributes

Statestate


Detailed Description

Class used to pass information about a token from lexer to parser.

Generally an instance of this class carries term information, but it can be used for the start or end of a value range, with some operators (e.g. the distance in NEAR/3 or ADJ/3, etc).

Definition at line 158 of file queryparser_internal.cc.


Constructor & Destructor Documentation

Term::Term ( const string &  name_,
termpos  pos_ 
) [inline]

Definition at line 168 of file queryparser_internal.cc.

Referenced by as_positional_cjk_term().

Term::Term ( const string &  name_  )  [inline]

Definition at line 169 of file queryparser_internal.cc.

Term::Term ( const string &  name_,
const PrefixInfo prefix_info_ 
) [inline]

Definition at line 170 of file queryparser_internal.cc.

Term::Term ( termpos  pos_  )  [inline]

Definition at line 173 of file queryparser_internal.cc.

Term::Term ( State state_,
const string &  name_,
const PrefixInfo prefix_info_,
const string &  unstemmed_,
QueryParser::stem_strategy  stem_ = QueryParser::STEM_NONE,
termpos  pos_ = 0 
) [inline]

Definition at line 174 of file queryparser_internal.cc.

Term::Term ( valueno  slot,
const string &  a,
const string &  b 
) [inline]

Definition at line 181 of file queryparser_internal.cc.


Member Function Documentation

Query * Term::as_cjk_query (  )  const

Build a query for a string of CJK characters.

Definition at line 454 of file queryparser_internal.cc.

References pos, prefix_info, and PrefixInfo::prefixes.

Query * Term::as_partial_query ( State state_  )  const

Build a query for a term at the very end of the query string when FLAG_PARTIAL is in use.

This query should match documents containing any terms which start with the characters specified, but should give a higher score to exact matches (since the user might have finished typing - we simply don't know).

Definition at line 425 of file queryparser_internal.cc.

References Xapian::Database::allterms_begin(), Xapian::Database::allterms_end(), State::get_database(), make_term(), pos, prefix_info, and PrefixInfo::prefixes.

void Term::as_positional_cjk_term ( Terms terms  )  const

Handle a CJK character string in a positional context.

Definition at line 1620 of file queryparser_internal.cc.

References Terms::add_positional_term(), Xapian::Unicode::append_utf8(), pos, state, stem, Term(), and unstemmed.

Query Term::as_value_range_query (  )  const

Value range query.

Definition at line 472 of file queryparser_internal.cc.

References pos, and unstemmed.

Query * Term::as_wildcarded_query ( State state  )  const

filter_group_id Term::get_filter_group_id (  )  const [inline]

Definition at line 192 of file queryparser_internal.cc.

References prefix_info.

Query Term::get_query (  )  const

Query Term::get_query_with_auto_synonyms (  )  const

Definition at line 349 of file queryparser_internal.cc.

References State::flags, get_query(), get_query_with_synonyms(), and state.

Query Term::get_query_with_synonyms (  )  const

termpos Term::get_termpos (  )  const [inline]

Definition at line 190 of file queryparser_internal.cc.

References pos.

string Term::make_term ( const string &  prefix  )  const

void Term::need_positions (  )  [inline]

Definition at line 186 of file queryparser_internal.cc.

References stem.

Referenced by Terms::add_positional_term().


Member Data Documentation

string Term::name

Definition at line 162 of file queryparser_internal.cc.

Referenced by State::add_to_stoplist(), and State::is_stopword().

termpos Term::pos

State* Term::state [private]


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

Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.