ddc
Public Attributes | List of all members
CQueryOptions Class Reference

root-level query options (filters and flags) More...

#include <QueryOptions.h>

Inheritance diagram for CQueryOptions:
Inheritance graph
[legend]
Collaboration diagram for CQueryOptions:
Collaboration graph
[legend]

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...
 
CQueryOptionsClone (void) const
 clone object (wraps new() and assign()) More...
 
CQueryOptionsSafeClone ()
 "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...
 
CQFilterPrimarySortFilter () 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 >
ddcObjectTraverse (Visit &visit)
 
template<typename Visit >
ddcObjectTraverse (Visit &visit) const
 
template<typename Visit >
ddcObjectTraverseR (Visit &visit)
 
template<typename Visit >
ddcObjectTraverseR (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< CDDCFilterWithBoundsm_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...
 

Detailed Description

root-level query options (filters and flags)

Constructor & Destructor Documentation

◆ CQueryOptions()

CQueryOptions::CQueryOptions ( )
inline

Default constructor.

References assign(), swap(), and ~CQueryOptions().

Referenced by Clone(), and SafeClone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~CQueryOptions()

CQueryOptions::~CQueryOptions ( void  )
virtual

Default destructor; calls Clear.

References Clear().

Referenced by CQueryOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ swap()

void CQueryOptions::swap ( CQueryOptions x)

◆ assign()

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().

Here is the caller graph for this function:

◆ Clone()

CQueryOptions* CQueryOptions::Clone ( void  ) const
inline

clone object (wraps new() and assign())

References assign(), and CQueryOptions().

Here is the call graph for this function:

◆ SafeClone()

CQueryOptions* CQueryOptions::SafeClone ( )
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().

Here is the call graph for this function:

◆ CheckSatisfiable()

bool CQueryOptions::CheckSatisfiable ( CQueryCompiler compiler)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Compile()

bool CQueryOptions::Compile ( CQueryCompiler compiler)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void CQueryOptions::Clear ( )
virtual

clear options.

References m_Comments, m_Filters, m_LexerComments, m_QFilters, and m_Subcorpora.

Referenced by CQueryCompiler::CleanParser(), SafeClone(), CQueryCompiler::SetQuery(), and ~CQueryOptions().

Here is the caller graph for this function:

◆ ClearComments()

void CQueryOptions::ClearComments ( )

clear comments

References m_Comments, and m_LexerComments.

Referenced by SafeClone().

Here is the caller graph for this function:

◆ CanFilterByFile()

bool CQueryOptions::CanFilterByFile ( ) const

returns true iff all defined filters are file-based (for optimized count(*) evaluation)

References m_Filters.

Referenced by SafeClone().

Here is the caller graph for this function:

◆ IsTrivialFilter()

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().

Here is the caller graph for this function:

◆ PrimarySortFilter()

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().

Here is the caller graph for this function:

◆ IsPruneFilter()

bool CQueryOptions::IsPruneFilter ( void  ) const

returns true iff the primary sort-filter is prune-filter

References CQFilter::FilterType(), IsPruneFilterType(), and PrimarySortFilter().

Referenced by SafeClone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Children()

ddcObjectList CQueryOptions::Children ( ) const
virtual

get a list of direct ddcObject daughters of this node

  • default just returns an empty list
  • useful for external wrappers (e.g. perl reference-counting)

Reimplemented from ddcObject.

References m_QFilters.

Referenced by SafeClone().

Here is the caller graph for this function:

◆ DisownChildren()

void CQueryOptions::DisownChildren ( )
virtual

"disown" any direct child objects, preventing their destruction if the current object is deleted

  • default implementation does nothing

Reimplemented from ddcObject.

References m_QFilters.

Referenced by SafeClone().

Here is the caller graph for this function:

◆ toString()

string CQueryOptions::toString ( void  )
virtual

convert object to a canonical string ()

  • default implementation just returns "CLASSNAME=PTRVAL"

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jsonClass()

virtual string CQueryOptions::jsonClass ( void  )
inlinevirtual

class-name for json strinfication

  • default implementation returns C++ class name

Reimplemented from ddcObject.

References jsonData().

Here is the call graph for this function:

◆ jsonData()

string CQueryOptions::jsonData ( void  )
virtual

instance data for json stringification

  • default implementation returns "NODATA":1, for strict syntax compliance

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_ContextSentencesCount

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().

◆ m_bEnableBibliography

bool CQueryOptions::m_bEnableBibliography

(CConcIndexator::m_bOutputBibliographyOfHits is default value for outputting bibliography

Referenced by assign(), jsonData(), swap(), and toString().

◆ m_bDebugRank

bool CQueryOptions::m_bDebugRank

if true, DDC initializes CHit::m_DebugRank

Referenced by assign(), CConcSession::InitSortByRank(), jsonData(), swap(), and toString().

◆ m_bSeparateHits

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().

◆ m_TextAreaNo

int CQueryOptions::m_TextAreaNo

the index of text area where DDC should perform the input query

Referenced by assign(), Compile(), and swap().

◆ m_Within

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().

◆ m_HitTypeStr

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().

◆ m_QFilters

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().

◆ m_Filters

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().

◆ m_Subcorpora

CQSubcorpusList CQueryOptions::m_Subcorpora

selected subcorpora for this query

Referenced by assign(), CheckSatisfiable(), Clear(), jsonData(), CDDCBranchServer::ReadSelectedHosts(), swap(), and toString().

◆ m_Comments

CQCommentList CQueryOptions::m_Comments

user comments for this query (#CMT[comment text])

Referenced by assign(), Clear(), ClearComments(), jsonData(), swap(), and toString().

◆ m_LexerComments

CQCommentList CQueryOptions::m_LexerComments

lexer comments for this query (#[lexer comment], #:line comment)

Referenced by assign(), Clear(), ClearComments(), jsonData(), swap(), toString(), and CQueryCompiler::yyqlex().


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