ddc
|
root-level query options (filters and flags) More...
#include <QueryOptions.h>
Public Member Functions | |
Constructors etc. | |
CQueryOptions () | |
Default constructor. More... | |
virtual | ~CQueryOptions (void) |
Default destructor; calls Clear. More... | |
void | swap (CQueryOptions &x) |
swap options More... | |
void | assign (const CQueryOptions &src, bool deep=true) |
assign options (copies filter list if deep is true) More... | |
CQueryOptions * | Clone (void) const |
clone object (wraps new() and assign()) More... | |
CQueryOptions * | SafeClone () |
"safe" clone, used by CQFPrune (wraps new() and assign(*this,false)) More... | |
CQueryOptions API | |
virtual bool | CheckSatisfiable (CQueryCompiler *compiler) |
Run optional fast unsatisfiability checks for query before Compile() is called. More... | |
virtual bool | Compile (CQueryCompiler *compiler) |
Compile index-dependent filter properties (required for evaluation) More... | |
virtual void | Clear () |
clear options. More... | |
void | ClearComments () |
clear comments More... | |
bool | CanFilterByFile () const |
returns true iff all defined filters are file-based (for optimized count(*) evaluation) More... | |
bool | IsTrivialFilter () const |
returns true iff all defined filters are trivial (i.e. do not change default hit-sort order) More... | |
CQFilter * | PrimarySortFilter () const |
returns a pointer (into m_QFilters) to the primary sort-filter, or NULL if no sort-filters are defined More... | |
bool | IsPruneFilter () const |
returns true iff the primary sort-filter is prune-filter More... | |
ddcObject API | |
virtual ddcObjectList | Children () const |
virtual void | DisownChildren () |
virtual string | toString () |
virtual string | jsonClass () |
virtual string | jsonData () |
Public Member Functions inherited from ddcObject | |
ddcObject () | |
Default constructor. More... | |
virtual | ~ddcObject () |
virtual destructor does nothing More... | |
template<typename Visit > | |
ddcObject * | Traverse (Visit &visit) |
template<typename Visit > | |
ddcObject * | Traverse (Visit &visit) const |
template<typename Visit > | |
ddcObject * | TraverseR (Visit &visit) |
template<typename Visit > | |
ddcObject * | TraverseR (Visit &visit) const |
virtual ddcObjectList | Descendants () const |
virtual string | toJson () |
Public Attributes | |
size_t | m_ContextSentencesCount |
how many hits of the left and right context should be output (must be <= m_MaxContextSentencesCount) More... | |
bool | m_bEnableBibliography |
(CConcIndexator::m_bOutputBibliographyOfHits is default value for outputting bibliography More... | |
bool | m_bDebugRank |
if true, DDC initializes CHit::m_DebugRank More... | |
bool | m_bSeparateHits |
int | m_TextAreaNo |
the index of text area where DDC should perform the input query More... | |
vector< string > | m_Within |
list of all 'WITHIN' arguments (break collections or text areas) from currently parsed query More... | |
string | m_HitTypeStr |
the break collection name which should be used while querying More... | |
CQFilterList | m_QFilters |
(abstract) filters and sort operators which should be applied to the resulted hit set More... | |
vector< CDDCFilterWithBounds > | m_Filters |
(runtime) filters and sort operators which should be applied to the resulted hit set (available after Compile()) More... | |
CQSubcorpusList | m_Subcorpora |
selected subcorpora for this query More... | |
CQCommentList | m_Comments |
user comments for this query (#CMT[comment text]) More... | |
CQCommentList | m_LexerComments |
lexer comments for this query (#[lexer comment], #:line comment) More... | |
Public Attributes inherited from ddcObject | |
void * | m_User |
user data associated with this object (for use e.g. by perl wrappers) More... | |
root-level query options (filters and flags)
|
inline |
Default constructor.
References assign(), swap(), and ~CQueryOptions().
Referenced by Clone(), and SafeClone().
|
virtual |
Default destructor; calls Clear.
References Clear().
Referenced by CQueryOptions().
void CQueryOptions::swap | ( | CQueryOptions & | x | ) |
swap options
References m_bDebugRank, m_bEnableBibliography, m_bSeparateHits, m_Comments, m_ContextSentencesCount, m_Filters, m_HitTypeStr, m_LexerComments, m_QFilters, m_Subcorpora, m_TextAreaNo, and m_Within.
Referenced by CQueryOptions(), and CQueryCompiler::SetQuery().
void CQueryOptions::assign | ( | const CQueryOptions & | src, |
bool | deep = true |
||
) |
assign options (copies filter list if deep is true)
References m_bDebugRank, m_bEnableBibliography, m_bSeparateHits, m_Comments, m_ContextSentencesCount, m_Filters, m_HitTypeStr, m_LexerComments, m_QFilters, m_Subcorpora, m_TextAreaNo, and m_Within.
Referenced by Clone(), CQueryOptions(), and SafeClone().
|
inline |
clone object (wraps new() and assign())
References assign(), and CQueryOptions().
|
inline |
"safe" clone, used by CQFPrune (wraps new() and assign(*this,false))
References assign(), CanFilterByFile(), CheckSatisfiable(), Children(), Clear(), ClearComments(), Compile(), CQueryOptions(), DisownChildren(), IsPruneFilter(), IsTrivialFilter(), PrimarySortFilter(), and toString().
|
virtual |
Run optional fast unsatisfiability checks for query before Compile() is called.
References CConcordance::GetRegexOptions(), CConcSession::m_pConcordance, CQueryCompiler::m_pHolder, m_QFilters, CConcSession::m_RequestPath, m_Subcorpora, and SubcorpusRequestRegex().
Referenced by CQuery::CheckSatisfiable(), and SafeClone().
|
virtual |
Compile index-dependent filter properties (required for evaluation)
References errParseError, CConcordance::m_BiblIndex, m_ContextSentencesCount, m_Filters, m_HitTypeStr, CQueryCompiler::m_MaxContextSentencesCount, CConcSession::m_pConcordance, CQueryCompiler::m_pHolder, m_QFilters, m_TextAreaNo, m_Within, NoSort, CHitBorders::WithinBreakName(), and CBiblIndex::WithinTextArea().
Referenced by CQuery::CompileOptions(), and SafeClone().
|
virtual |
clear options.
References m_Comments, m_Filters, m_LexerComments, m_QFilters, and m_Subcorpora.
Referenced by CQueryCompiler::CleanParser(), SafeClone(), CQueryCompiler::SetQuery(), and ~CQueryOptions().
void CQueryOptions::ClearComments | ( | ) |
clear comments
References m_Comments, and m_LexerComments.
Referenced by SafeClone().
bool CQueryOptions::CanFilterByFile | ( | ) | const |
returns true iff all defined filters are file-based (for optimized count(*) evaluation)
References m_Filters.
Referenced by SafeClone().
bool CQueryOptions::IsTrivialFilter | ( | void | ) | const |
returns true iff all defined filters are trivial (i.e. do not change default hit-sort order)
References m_Filters.
Referenced by CQCount::CountLocal(), and SafeClone().
CQFilter * CQueryOptions::PrimarySortFilter | ( | ) | const |
returns a pointer (into m_QFilters) to the primary sort-filter, or NULL if no sort-filters are defined
References m_QFilters, and NoSort.
Referenced by IsPruneFilter(), CDDCBranchServer::RunGetFirstHits(), and SafeClone().
bool CQueryOptions::IsPruneFilter | ( | void | ) | const |
returns true iff the primary sort-filter is prune-filter
References CQFilter::FilterType(), IsPruneFilterType(), and PrimarySortFilter().
Referenced by SafeClone().
|
virtual |
get a list of direct ddcObject daughters of this node
Reimplemented from ddcObject.
References m_QFilters.
Referenced by SafeClone().
|
virtual |
"disown" any direct child objects, preventing their destruction if the current object is deleted
Reimplemented from ddcObject.
References m_QFilters.
Referenced by SafeClone().
|
virtual |
convert object to a canonical string ()
Reimplemented from ddcObject.
References escapeChars(), Format(), m_bDebugRank, m_bEnableBibliography, m_bSeparateHits, m_Comments, m_ContextSentencesCount, m_HitTypeStr, m_LexerComments, m_QFilters, m_Subcorpora, m_Within, PredefinedFileBreakName, and sqString().
Referenced by CQuery::optionsToString(), and SafeClone().
|
inlinevirtual |
class-name for json strinfication
Reimplemented from ddcObject.
References jsonData().
|
virtual |
instance data for json stringification
Reimplemented from ddcObject.
References Format(), jsonArray(), jsonStr(), m_bDebugRank, m_bEnableBibliography, m_bSeparateHits, m_Comments, m_ContextSentencesCount, m_HitTypeStr, m_LexerComments, m_QFilters, m_Subcorpora, and m_Within.
Referenced by jsonClass().
size_t CQueryOptions::m_ContextSentencesCount |
how many hits of the left and right context should be output (must be <= m_MaxContextSentencesCount)
Referenced by assign(), Compile(), jsonData(), swap(), and toString().
bool CQueryOptions::m_bEnableBibliography |
(CConcIndexator::m_bOutputBibliographyOfHits is default value for outputting bibliography
Referenced by assign(), jsonData(), swap(), and toString().
bool CQueryOptions::m_bDebugRank |
if true, DDC initializes CHit::m_DebugRank
Referenced by assign(), CConcSession::InitSortByRank(), jsonData(), swap(), and toString().
bool CQueryOptions::m_bSeparateHits |
whether to return a separate hit for each occurrence, or collect into distinct instances of the selected container (sentence) default=false; used by CQueryNode::Evaluate()
Referenced by assign(), CQCount::CountLocal(), CQCount::CountUniversal(), CQuery::Evaluate(), CConcSession::GetAllHits(), jsonData(), swap(), and toString().
int CQueryOptions::m_TextAreaNo |
vector<string> CQueryOptions::m_Within |
list of all 'WITHIN' arguments (break collections or text areas) from currently parsed query
Referenced by assign(), Compile(), jsonData(), swap(), and toString().
string CQueryOptions::m_HitTypeStr |
the break collection name which should be used while querying
Referenced by assign(), Compile(), CQCount::CountLocal(), CQCount::CountUniversal(), jsonData(), swap(), and toString().
CQFilterList CQueryOptions::m_QFilters |
(abstract) filters and sort operators which should be applied to the resulted hit set
Referenced by assign(), CheckSatisfiable(), Children(), Clear(), Compile(), DisownChildren(), jsonData(), PrimarySortFilter(), swap(), and toString().
vector<CDDCFilterWithBounds> CQueryOptions::m_Filters |
(runtime) filters and sort operators which should be applied to the resulted hit set (available after Compile())
Referenced by assign(), CanFilterByFile(), Clear(), CQFSort::Compile(), Compile(), CQCount::CountUniversal(), CConcSession::GetAllHits(), IsTrivialFilter(), and swap().
CQSubcorpusList CQueryOptions::m_Subcorpora |
selected subcorpora for this query
Referenced by assign(), CheckSatisfiable(), Clear(), jsonData(), CDDCBranchServer::ReadSelectedHosts(), swap(), and toString().
CQCommentList CQueryOptions::m_Comments |
user comments for this query (#CMT[comment text])
Referenced by assign(), Clear(), ClearComments(), jsonData(), swap(), and toString().
CQCommentList CQueryOptions::m_LexerComments |
lexer comments for this query (#[lexer comment], #:line comment)
Referenced by assign(), Clear(), ClearComments(), jsonData(), swap(), toString(), and CQueryCompiler::yyqlex().