CQueryNode is an abstract class for any node in a query parse tree. A parse tree is built by YACC during CQueryParser::ParseQuery. This class contains all members which are common to atomic and operation nodes. More...
#include <QueryNode.h>
CQueryNode is an abstract class for any node in a query parse tree. A parse tree is built by YACC during CQueryParser::ParseQuery. This class contains all members which are common to atomic and operation nodes.
CQueryNode::CQueryNode | ( | bool | bUseNodeIndices = false , |
|
bool | bUseTokenIdxs = false , |
|||
const CConcHolder * | holder = NULL | |||
) | [inline] |
CQueryNode::~CQueryNode | ( | ) | [virtual] |
References ClearVector(), m_OccurrenceNodeIndices, m_Occurrences, and m_OccurrenceTokenIdxs.
void CQueryNode::Evaluate | ( | ) | [virtual] |
Reimplemented in CQueryAndOperation, CQueryOrOperation, CQueryTokenNode, CQuerySequenceNode, CQueryNearNode, and CQueryWithNode.
Referenced by CQueryParser::Evaluate(), CQueryOrOperation::Evaluate(), and CQueryAndOperation::Evaluate().
void CQueryNode::EvaluateWithoutHits | ( | ) | [virtual] |
Reimplemented in CQueryTokenNode, CQuerySequenceNode, and CQueryWithNode.
Referenced by CQueryNearNode::Evaluate(), and CConcHolder::GetOccurrences().
void CQueryNode::SetNegation | ( | bool | Value | ) |
set m_bNegated
References m_bNegated.
Referenced by CQueryOrOperation::Evaluate(), and CQueryAndOperation::Evaluate().
bool CQueryNode::GetNegation | ( | ) | const |
get m_bNegated
References m_bNegated.
Referenced by CQueryOrOperation::Evaluate(), and CQueryAndOperation::Evaluate().
void CQueryNode::AddOccurrences | ( | const CQueryNode & | FromNode, | |
int | start, | |||
int | end | |||
) |
References m_bUseNodeIndices, m_bUseTokenIdxs, m_OccurrenceNodeIndices, m_Occurrences, and m_OccurrenceTokenIdxs.
Referenced by ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CQueryNearNode::Evaluate(), CQuerySequenceNode::EvaluateWithoutHits(), CQueryBinaryOperationNode::hits_add(), CQueryBinaryOperationNode::hits_and_positions_difference(), CQueryBinaryOperationNode::hits_and_positions_intersection(), and CQueryBinaryOperationNode::hits_and_positions_union().
void CQueryNode::ClearAndReserveOccurrences | ( | int | size | ) |
References m_bUseNodeIndices, m_bUseTokenIdxs, m_OccurrenceNodeIndices, m_Occurrences, and m_OccurrenceTokenIdxs.
Referenced by ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CQueryNearNode::Evaluate(), CQuerySequenceNode::EvaluateWithoutHits(), CQueryTokenNode::EvaluateWithoutHits(), CQueryBinaryOperationNode::hits_and_positions_difference(), CQueryBinaryOperationNode::hits_and_positions_intersection(), and CQueryBinaryOperationNode::hits_and_positions_union().
void CQueryNode::SwapOccurrences | ( | CQueryNode & | Node | ) |
References m_OccurrenceNodeIndices, m_Occurrences, and m_OccurrenceTokenIdxs.
Referenced by ConvertOccurrencesToHits(), and ConvertOccurrencesToHitsForPatterns().
void CQueryNode::ConvertOccurrencesToHits | ( | bool | bUniqueHits | ) |
convert occurrences to hits using m_pHolder->GetBreaks()
References AddOccurrences(), ClearAndReserveOccurrences(), CConcHolder::GetBreaks(), GetOccurrencesSize, CConcHolder::GetTextArea(), CConcXml::GetTextAreasCount(), CConcIndexator::m_Bibl, CHit::m_BreakNo, m_bUseNodeIndices, m_bUseTokenIdxs, CHit::m_HighlightOccurrenceEnd, m_Hits, m_Occurrences, m_pHolder, CConcHolder::m_pIndexator, SwapOccurrences(), and UnknownTextAreaNo.
Referenced by CQueryWithNode::Evaluate(), and CQueryTokenNode::Evaluate().
void CQueryNode::ConvertOccurrencesToHitsForPatterns | ( | bool | bUniqueHits | ) |
convert occurrences to hits for pattern query construction (like "mother likes father")
References AddOccurrences(), ClearAndReserveOccurrences(), CConcHolder::GetBreaks(), GetOccurrencesSize, CConcHolder::GetTextArea(), CConcXml::GetTextAreasCount(), CConcIndexator::m_Bibl, CHit::m_BreakNo, m_bUseNodeIndices, m_bUseTokenIdxs, m_ChunkLengths, CHit::m_HighlightOccurrenceEnd, m_Hits, m_Occurrences, m_pHolder, CConcHolder::m_pIndexator, SwapOccurrences(), and UnknownTextAreaNo.
Referenced by CQueryNearNode::Evaluate(), CQuerySequenceNode::Evaluate(), CQueryTokenNode::Evaluate(), and CConcHolder::GetOccurrences().
void CQueryNode::SetHolder | ( | const CConcHolder * | pHolder | ) |
set m_pHolder
References CConcHolder::GetBigramsToOrder(), CConcHolder::HasRankOrderOperator(), m_bUseNodeIndices, m_bUseTokenIdxs, and m_pHolder.
Referenced by CQueryNearNode::Create(), CQuerySequenceNode::Create(), CQueryBinaryOperationNode::Create(), CQueryTokenNode::CreateChunkPattern(), CQueryTokenNode::CreateFileList(), CQueryTokenNode::CreateMorphAnnotationPattern(), CQueryTokenNode::CreateNodeByIndexName(), CQueryTokenNode::CreateThesPattern(), and CQueryTokenNode::CreateTokenPattern().
size_t CQueryNode::GetNodeFrequenceByNodeIndex | ( | size_t | NodeIndex | ) | const [virtual] |
Reimplemented in CQueryBinaryOperationNode, CQueryTokenNode, CQuerySequenceNode, and CQueryNearNode.
Referenced by CQueryNearNode::GetNodeFrequenceByNodeIndex(), CQueryBinaryOperationNode::GetNodeFrequenceByNodeIndex(), and CConcHolder::InitLessByRank().
true if this node is a description of one token or a sequence of adjacent tokens
Referenced by CQuerySequenceNode::CQuerySequenceNode(), CQueryTokenNode::CQueryTokenNode(), CQueryWithNode::CQueryWithNode(), CQueryNearNode::Create(), CQueryTokenNode::CreateChunkPattern(), and CConcHolder::GetOccurrences().
is the node negated?
Referenced by GetNegation(), and SetNegation().
string CQueryNode::m_Source |
the string from which this node was created
Referenced by CQueryBinaryOperationNode::Create(), CQueryTokenNode::CreateChunkPattern(), CQueryTokenNode::CreateFileList(), CQueryTokenNode::CreateMorphAnnotationPattern(), CQueryTokenNode::CreateNodeByIndexName(), CQueryTokenNode::CreateThesPattern(), and CQueryTokenNode::CreateTokenPattern().
vector<CTokenNo> CQueryNode::m_Occurrences |
all occurrences of this node in the current subcorpus, which should be highlighted
Referenced by AddOccurrences(), ClearAndReserveOccurrences(), ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CQueryNearNode::Evaluate(), CQueryWithNode::EvaluateWithoutHits(), CQuerySequenceNode::EvaluateWithoutHits(), CQueryTokenNode::EvaluateWithoutHits(), CConcHolder::GetAllHits(), CQueryTokenNode::GetNodeFrequenceByNodeIndex(), CConcHolder::GetOccurrences(), CConcHolder::InitLessByRank(), CQueryWithNode::OccurIntersectionWithTokenIds(), SwapOccurrences(), and ~CQueryNode().
should DDC uses m_OccurrenceNodeIndices (m_OccurrenceNodeIndices is necessary only for less_by_rank)
Referenced by AddOccurrences(), ClearAndReserveOccurrences(), ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CQueryWithNode::EvaluateWithoutHits(), CQueryTokenNode::EvaluateWithoutHits(), and SetHolder().
query node indices for each occurrence (the origin for each occurrence)
Referenced by AddOccurrences(), ClearAndReserveOccurrences(), CQueryWithNode::EvaluateWithoutHits(), CQueryTokenNode::EvaluateWithoutHits(), CConcHolder::InitLessByRank(), SwapOccurrences(), and ~CQueryNode().
should DDC use m_OccurrenceTokenIdxs,
Referenced by AddOccurrences(), ClearAndReserveOccurrences(), ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CQueryTokenNode::EvaluateWithoutHits(), and SetHolder().
token idxs for each occurrence (it is used for left or right query operators)
Referenced by AddOccurrences(), ClearAndReserveOccurrences(), CQueryWithNode::EvaluateWithoutHits(), CQueryTokenNode::EvaluateWithoutHits(), CConcHolder::InitLessByBigrams(), CQueryWithNode::OccurIntersectionWithTokenIds(), SwapOccurrences(), and ~CQueryNode().
vector<CHit> CQueryNode::m_Hits |
all hits of this node in the current subcorpora
Referenced by ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CConcHolder::GetAllHits(), CConcHolder::GetOccurrences(), CQueryBinaryOperationNode::hits_add(), CQueryBinaryOperationNode::hits_and_positions_difference(), CQueryBinaryOperationNode::hits_and_positions_intersection(), CQueryBinaryOperationNode::hits_and_positions_union(), CConcHolder::InitGreaterByRank(), CConcHolder::InitGreaterBySize(), CConcHolder::InitLessByBigrams(), CConcHolder::InitLessByRank(), CConcHolder::InitLessBySize(), and CConcHolder::InitOrderIDForHits().
const CConcHolder* CQueryNode::m_pHolder |
a reference to the parent holder (moo: can be NULL until evaluation time)
Referenced by CQueryTokenNode::BuildRegExp(), ConvertOccurrencesToHits(), ConvertOccurrencesToHitsForPatterns(), CQueryTokenNode::CreateFileList(), CQueryTokenNode::CreateMorphAnnotationPattern(), CQueryTokenNode::CreateTokenPattern(), CQueryTokenNode::EvaluateWithoutHits(), and SetHolder().
vector<size_t> CQueryNode::m_ChunkLengths |
the division of m_Occurrences by chunks , so m_ChunkLengths[0]+m_ChunkLengths[1]... = m_Occurrences.size()
Referenced by ConvertOccurrencesToHitsForPatterns(), CQueryNearNode::Evaluate(), CQueryWithNode::EvaluateWithoutHits(), CQuerySequenceNode::EvaluateWithoutHits(), CQueryTokenNode::EvaluateWithoutHits(), and CConcHolder::GetOccurrences().
vector<int> CQueryNode::m_CacheIds |
???
Referenced by CQueryTokenNode::EvaluateWithoutHits().