49#include <lal/basic_types.hpp>
50#include <lal/graphs/rooted_tree.hpp>
51#include <lal/io/treebank_file_error.hpp>
104 (
const std::string& treebank_filename,
const std::string& treebank_id =
"")
Rooted tree graph class.
Definition rooted_tree.hpp:109
Treebank file error report class.
Definition treebank_file_error.hpp:64
A reader for a single treebank file.
Definition treebank_reader.hpp:89
std::string m_treebank_file
Treebank's file name (with the full path).
Definition treebank_reader.hpp:194
bool is_open() const noexcept
Can the treebank be read?
Definition treebank_reader.hpp:149
bool m_calculate_tree_type
Calculate the type of tree of the generated tree.
Definition treebank_reader.hpp:210
bool end() const noexcept
Returns whether there is another tree to be processed.
Definition treebank_reader.hpp:108
void next_tree() noexcept
Retrieves the next tree in the file.
std::size_t get_num_trees() const noexcept
Returns the number of trees processed so far.
Definition treebank_reader.hpp:124
bool m_normalize_tree
Normalize the current tree.
Definition treebank_reader.hpp:206
const std::string & get_treebank_identifier() const noexcept
Returns the identifier corresponding of the treebank.
Definition treebank_reader.hpp:128
std::string m_current_line
Current line.
Definition treebank_reader.hpp:201
head_vector get_head_vector() const noexcept
Returns the current head vector.
Definition treebank_reader.hpp:139
bool m_no_more_trees
Have all trees in the file been consumed?
Definition treebank_reader.hpp:212
const std::string & get_treebank_filename() const noexcept
Returns the name of the treebank file.
Definition treebank_reader.hpp:132
head_vector m_current_head_vector
Current head vector.
Definition treebank_reader.hpp:203
std::size_t m_num_trees
Number of trees in the treebank.
Definition treebank_reader.hpp:199
void set_identifier(const std::string &id) noexcept
Set this treebank's identifier string.
Definition treebank_reader.hpp:187
void set_calculate_size_subtrees(const bool v) noexcept
Should the size of the subtrees be calculated?
Definition treebank_reader.hpp:165
void set_calculate_tree_type(const bool v) noexcept
Should the tree be classified into types?
Definition treebank_reader.hpp:175
treebank_file_error init(const std::string &treebank_filename, const std::string &treebank_id="") noexcept
Initializes the treebank reader.
std::string m_treebank_identifier
Identifier for the treebank.
Definition treebank_reader.hpp:192
void set_normalize(const bool v) noexcept
Should trees be normalized?
Definition treebank_reader.hpp:157
bool m_calculate_size_subtrees
Calculate the size of the subtrees of the generated rooted tree.
Definition treebank_reader.hpp:208
graphs::rooted_tree get_tree() const noexcept
Returns the current tree.
std::ifstream m_treebank
Handler for main file reading.
Definition treebank_reader.hpp:196
Main namespace of the library.
Definition basic_types.hpp:48
std::vector< uint64_t > head_vector
See Head vector page for further details.
Definition basic_types.hpp:58