data: fixes for clearing on refresh

* reduce aggregation count when clearing
* added TokenLocation to method override edge
* added TokenLocations to template related edges
This commit is contained in:
Eberhard Graether
2015-05-18 16:22:39 +02:00
parent f0e101e994
commit 1f3be0e60d
13 changed files with 134 additions and 48 deletions
+7
View File
@@ -134,3 +134,10 @@ std::vector<SearchMatch> SearchIndex::runFuzzySearchAndGetMatches(const std::str
}
const std::string SearchIndex::DELIMITER = "::";
std::ostream& operator<<(std::ostream& ostream, const SearchIndex& index)
{
ostream << "SearchIndex:\n";
ostream << &index.m_root;
return ostream;
}
+4
View File
@@ -41,6 +41,10 @@ public:
private:
SearchNode m_root;
Dictionary m_dictionary;
friend std::ostream& operator<<(std::ostream& ostream, const SearchIndex& index);
};
std::ostream& operator<<(std::ostream& ostream, const SearchIndex& index);
#endif // SEARCH_INDEX_H
+19
View File
@@ -407,3 +407,22 @@ std::deque<const SearchNode*> SearchNode::getNodesToParent(const SearchNode* par
return nodes;
}
std::ostream& operator<<(std::ostream& ostream, const SearchNode* node)
{
ostream << node->m_name;
for (Id tokenId : node->m_tokenIds)
{
ostream << ' ' << tokenId;
}
ostream << '\n';
for (const std::shared_ptr<SearchNode> n : node->m_nodes)
{
ostream << n.get();
}
return ostream;
}
+4
View File
@@ -77,6 +77,10 @@ private:
const std::string& m_name;
const Id m_nameId;
friend std::ostream& operator<<(std::ostream& ostream, const SearchNode* node);
};
std::ostream& operator<<(std::ostream& ostream, const SearchNode* node);
#endif // SEARCH_NODE_H