1 #ifndef XML_TREE_BUILDER_HPP_
2 #define XML_TREE_BUILDER_HPP_
5 #include <unordered_map>
6 #include "xml-tree.hpp"
7 #include "bit-vector.hpp"
11 #include <TextCollection/TextCollectionBuilder.h>
13 class xml_tree_builder {
18 void open_document(bool disable_text_index,
19 unsigned int sample_rate,
20 SXSI::TextCollectionBuilder::index_type_t idx_type);
22 xml_tree *close_document();
23 void open_tag(std::string);
24 void close_tag(std::string);
25 void text(std::string);
29 int32_t register_tag(std::string);
30 int32_t register_tag(std::string, int32_t);
34 std::vector<int32_t> *tags;
36 std::unordered_map<std::string, int32_t> *tag_ids;
40 bit_vector *text_positions;
41 SXSI::TextCollectionBuilder *tc_builder;
42 bool disable_text_index;
43 SXSI::TextCollectionBuilder::index_type_t text_index_type;