ddc
|
#include <QueryNode.h>
Public Member Functions | |
CQueryBinaryOperationNode () | |
CQueryBinaryOperationNode (CQueryNode *dtr1, CQueryNode *dtr2) | |
void | Create (const CConcHolder *pHolder, CQueryNode *child1, CQueryNode *child2, string Operation) |
virtual | ~CQueryBinaryOperationNode () |
void | pushHit (DWORD BreakNo) |
void | hits_and_positions_assign (const CQueryNode &NodeFrom) |
void | hits_and_positions_swap (CQueryNode &NodeFrom) |
hijack hit occurrences and positions from another node More... | |
void | hits_and_positions_union (bool bSeparateHits=false) |
void | hits_and_positions_intersection (bool bSeparateHits=false) |
void | hits_and_positions_difference (bool bSeparateHits=false) |
size_t | GetNodeFrequencyByNodeIndex (size_t NodeIndex) const |
get occurrence count by query-node index; used by rank-sort operator. More... | |
Public Member Functions inherited from CQueryNode | |
CQueryNode (bool bUseNodeIndices=false, bool bUseMatchIds=false, const CConcHolder *holder=NULL) | |
Constructor. More... | |
virtual | ~CQueryNode () |
Destructor. More... | |
virtual void | Evaluate (bool bSeparateHits=false) |
virtual void | EvaluateWithoutHits () |
initial-stage query evaluation EvaluateWithoutHits is the first stage of the evaluation of one query. The main task it to build CQueryNode::m_Occurrences, which is written by chunks, sorted by the first item of a chunk. More... | |
void | SetNegation (bool Value) |
set m_bNegated More... | |
bool | GetNegation () const |
get m_bNegated More... | |
void | AddOccurrence (const CQueryNode &FromNode, int FromOcc) |
insers a single occurrence FromNode.m_Occurrences[occ] More... | |
void | AddOccurrences (const CQueryNode &FromNode, int start, int end) |
inserts occurrences [FromNode.m_Occurrences.begin()+start, FromNode.m_Occurrences.begin()+end) into m_Occurrences[] (and m_OccurrenceNodeIndices if appropriate) More... | |
void | AddOccurrences2 (const CQueryNode &FromNode1, int start1, int end1, const CQueryNode &FromNode2, int start2, int end2) |
appends occurrences from both FromNode1 and FromNode2, maintaining sort-order and respecting both m_bUseNodeIndices and m_bUseMatchIds More... | |
void | AddOccurrences3 (const CQueryNode &FromNode1, int start1, int end1, const CQueryNode &FromNode2, int start2, int end2, const CQueryNode &FromNode3, int start3, int end3) |
appends occurrences from FromNode1, FromNode2, and FromNode3 maintaining sort-order and respecting both m_bUseNodeIndices and m_bUseMatchIds More... | |
void | ClearAndReserveOccurrences (int size) |
void | SwapOccurrences (CQueryNode &Node, bool swapChunkLengths=false) |
swaps m_Occurrences[], m_OccurrenceNodeIndices[], and m_OccurrenceMatchIds[] between caller object and Node More... | |
void | ConvertOccurrencesToHits (bool bSeparateHits) |
convert occurrences to hits using m_pHolder->GetBreaks() More... | |
void | ConvertOccurrencesToHitsForPatterns (bool bSeparateHits) |
convert occurrences to hits for pattern query construction (like "mother likes father") More... | |
void | EnsureChunkOffsets () |
ensure m_ChunkOffsets[] is populated More... | |
void | SetHolder (const CConcHolder *pHolder) |
set m_pHolder dependent properties m_bUseNodeIndices, m_bUseMatchIds More... | |
virtual bool | IsUniversalWildcard () const |
return true iff this is a universal wildcard query (*); default returns false More... | |
DWORD | HitOccurrencesBegin (DWORD HitNo) const |
get the index of the first occurrence in m_Occurrences[] for hit number HitNo More... | |
DWORD | HitOccurrencesEnd (DWORD HitNo) const |
get the index of the first occurrence in m_Occurrences[] after hit number HitNo More... | |
DWORD | GetFirstOccurrenceInHit (DWORD HitNo, BYTE MatchId) const |
DWORD | GetLastOccurrenceInHit (DWORD HitNo, BYTE MatchId) const |
DWORD | GetMiddleOccurrenceInHit (DWORD HitNo, BYTE MatchId) const |
DWORD | BreakStride () const |
get average size of gap between breaks in m_Hits[]; returned value is always >= 1 More... | |
Public Attributes | |
CQueryNode * | m_pChild1 |
the first operation member More... | |
CQueryNode * | m_pChild2 |
the second operation member More... | |
Public Attributes inherited from CQueryNode | |
bool | m_bAtomic |
true if this node is a description of one token or a sequence of adjacent tokens More... | |
bool | m_bNegated |
is the node negated? More... | |
string | m_Source |
the string from which this node was created More... | |
vector< CTokenNo > | m_Occurrences |
all occurrences of this node in the current subcorpus, which should be highlighted More... | |
bool | m_bUseNodeIndices |
should DDC uses m_OccurrenceNodeIndices (m_OccurrenceNodeIndices is necessary only for #less_by_rank) More... | |
vector< BYTE > | m_OccurrenceNodeIndices |
query node indices for each occurrence (the origin for each occurrence) More... | |
bool | m_bUseMatchIds |
should DDC use m_OccurrenceMatchIds to track match-ids? More... | |
vector< BYTE > | m_OccurrenceMatchIds |
match-ids for each occurrence in m_Occurrences (only if m_bUseMatchIds is true) More... | |
vector< CHit > | m_Hits |
all hits of this node in the current subcorpora More... | |
const CConcHolder * | m_pHolder |
a reference to the parent holder (moo: should be unused until evaluation time, but isn't!) More... | |
vector< DWORD > | m_ChunkLengths |
vector< DWORD > | m_ChunkOffsets |
vector< int > | m_CacheIds |
??? More... | |
Private Member Functions | |
void | hits_add (const CQueryNode &NodeFrom, vector< CHit >::const_iterator First) |
add the hit list of "NodeFrom" to the back of "First" More... | |
An abtsract class for binary logical operations on nodes (and, or). It contains instances of three major logical operation (union, intersection and difference) which were slightly modified to deal with CQueryNode::m_Hits and CQueryNode::m_Occurrences simultaneously.
|
inline |
|
inline |
|
virtual |
|
private |
add the hit list of "NodeFrom" to the back of "First"
References CQueryNode::AddOccurrences(), GetOccurrencesSize, CHit::m_HighlightOccurrenceEnd, and CQueryNode::m_Hits.
void CQueryBinaryOperationNode::Create | ( | const CConcHolder * | pHolder, |
CQueryNode * | child1, | ||
CQueryNode * | child2, | ||
string | Operation | ||
) |
References CQueryNode::m_Source, and CQueryNode::SetHolder().
Referenced by CQOr::Compile(), CQueryWithNode::Create(), CQueryWithoutNode::Create(), and CQueryWithorNode::Create().
|
inline |
push a single hit onto m_Hits[]
References CQueryNode::GetNodeFrequencyByNodeIndex(), CHit::m_HighlightOccurrenceEnd, CQueryNode::m_Hits, and CQueryNode::m_Occurrences.
void CQueryBinaryOperationNode::hits_and_positions_assign | ( | const CQueryNode & | NodeFrom | ) |
assign hit occurrences and positions from another node
References CQueryNode::AddOccurrences(), CQueryNode::ClearAndReserveOccurrences(), CQueryNode::m_Hits, and CQueryNode::m_Occurrences.
void CQueryBinaryOperationNode::hits_and_positions_swap | ( | CQueryNode & | NodeFrom | ) |
hijack hit occurrences and positions from another node
References CQueryNode::m_Hits, and CQueryNode::SwapOccurrences().
void CQueryBinaryOperationNode::hits_and_positions_union | ( | bool | bSeparateHits = false | ) |
a modified version of std::union which unites simultaneously two pairs of vectors
References CQueryNode::AddOccurrences(), CQueryNode::AddOccurrences2(), CQueryNode::ClearAndReserveOccurrences(), and CQueryNode::m_Hits.
void CQueryBinaryOperationNode::hits_and_positions_intersection | ( | bool | bSeparateHits = false | ) |
a modified version of std::intersection which simultaneously deals with two pairs of vectors
References CQueryNode::AddOccurrences2(), CQueryNode::ClearAndReserveOccurrences(), DDC_HIT_INTERSECTION_BINSEARCH_COEF, log2u32(), and CQueryNode::m_Hits.
void CQueryBinaryOperationNode::hits_and_positions_difference | ( | bool | bSeparateHits = false | ) |
a modified version of std::difference which simultaneously deals with two pairs of vectors
References CQueryNode::AddOccurrences(), CQueryNode::ClearAndReserveOccurrences(), DDC_HIT_INTERSECTION_BINSEARCH_COEF, log2u32(), and CQueryNode::m_Hits.
|
virtual |
get occurrence count by query-node index; used by rank-sort operator.
Reimplemented from CQueryNode.
CQueryNode* CQueryBinaryOperationNode::m_pChild1 |
the first operation member
Referenced by CQBinOp::ClearNode().
CQueryNode* CQueryBinaryOperationNode::m_pChild2 |
the second operation member
Referenced by CQBinOp::ClearNode().