48#include <lal/linear_arrangement.hpp>
49#include <lal/io/treebank_file_error.hpp>
50#include <lal/io/treebank_processor_base.hpp>
114 const std::string& treebank_input_file,
115 const std::string& output_file,
116 const std::string& treebank_id =
""
141 template <class TREE, class OUT_STREAM>
145 double * const props,
146 char * const prop_set,
147 OUT_STREAM& out_lab_file
154 template <class OUT_STREAM>
159 template <class OUT_STREAM>
166 template <class TREE_TYPE, class OUT_STREAM>
171 template <class TREE_TYPE, class OUT_STREAM>
176 OUT_STREAM& out_lab_file
260(const std::
string& treebank_file, const std::
string& output_file)
264 auto err = tbproc.
init(treebank_file, output_file);
265 if (not err.is_error()) {
return err; }
The processor base class.
Definition treebank_processor_base.hpp:61
Treebank file error report class.
Definition treebank_file_error.hpp:64
Automatic processing of treebank files.
Definition treebank_processor.hpp:99
std::string m_treebank_filename
File containing the list of languages and their treebanks.
Definition treebank_processor.hpp:182
std::string m_treebank_id
Treebank identifier.
Definition treebank_processor.hpp:186
treebank_file_error init(const std::string &treebank_input_file, const std::string &output_file, const std::string &treebank_id="") noexcept
Initialize the processor with a new collection.
treebank_file_error process() noexcept
Process the treebank file.
void output_tree_type_values(TREE_TYPE &t, OUT_STREAM &out_lab_file) const noexcept
Output the values for the tree types.
void output_tree_type_header(OUT_STREAM &out_lab_file) const noexcept
Output the header for the tree types.
void output_syndepstruct_type_header(OUT_STREAM &out_lab_file) const noexcept
Output the header for the tree types.
void output_syndepstruct_type_values(const TREE_TYPE &t, const uint64_t C, OUT_STREAM &out_lab_file) const noexcept
Output the values for the syntactic dependency tree types.
void process_tree(const TREE &rT, double *const props, char *const prop_set, OUT_STREAM &out_lab_file) noexcept
Process a single tree in a treebank.
std::string m_output_file
Output directory.
Definition treebank_processor.hpp:184
treebank_file_error process_treebank(const std::string &treebank_file, const std::string &output_file) noexcept
Automatically process a treebank.
Definition treebank_processor.hpp:260
treebank_feature_type
The features that can be computed in automatic processing of treebanks.
Definition treebank_feature_type.hpp:68
@ exp_num_crossings
First moment of expectation of , .
@ flux_min_size
Minimum flux size.
@ exp_sum_edge_lengths_bipartite
Expectation of constrained to bipartite arrangements, .
@ tree_centroid
Centroid of the tree.
@ z_score_num_crossings
z-score of , .
@ second_moment_degree_out
Second moment of out-degree .
@ num_nodes
Number of nodes of the tree.
@ flux_mean_right_span
Mean right span.
@ mean_hierarchical_distance
Mean hierarchical distance of the tree.
@ third_moment_degree
Third moment of degree .
@ min_sum_edge_lengths_projective
Minimum sum of length of edges under the planarity constraint.
@ flux_mean_RL_ratio
Mean R/L ratio.
@ flux_max_size
Maximum flux size.
@ max_sum_edge_lengths_1_thistle
Maximum sum of length of edges over arrangements with 1 thistle vertex.
@ head_initial
Headedness of the tree.
@ flux_mean_WS_ratio
Mean W/S ratio.
@ predicted_num_crossings
Prediction of the number of crossings .
@ max_sum_edge_lengths_planar
Maximum sum of length of edges under the planarity constraint.
@ sum_cubed_out_degrees
Sum of cube out-degrees.
@ hubiness
Hubiness of the tree.
@ flux_mean_weight
Mean flux weight.
@ flux_min_left_span
Minimum left span.
@ flux_min_RL_ratio
Minimum R/L ratio.
@ flux_mean_size
Mean flux size.
@ max_sum_edge_lengths_bipartite
Maximum sum of length of edges among bipartite arrangements.
@ third_moment_degree_out
Third moment of out-degree .
@ sum_edge_lengths
Sum of length of edges .
@ flux_max_WS_ratio
Maximum W/S ratio.
@ mean_dependency_distance
Mean dependency distance of the tree.
@ max_sum_edge_lengths_projective
Maximum sum of length of edges under the planarity constraint.
@ flux_min_right_span
Minimum right span.
@ num_crossings
Number of edge crossings .
@ flux_max_left_span
Maximum left span.
@ sum_squared_degrees
Sum of squared degrees.
@ var_num_crossings
Variance of , .
@ flux_max_RL_ratio
Maximum R/L ratio.
@ flux_max_right_span
Maximum right span.
@ sum_cubed_degrees
Sum of cube degrees.
@ second_moment_degree
Second moment of degree .
@ tree_centre
Centre of the tree.
@ min_sum_edge_lengths_planar
Minimum sum of length of edges under the planarity constraint.
@ num_pairs_independent_edges
Size of the set of this tree .
@ z_score_sum_edge_lengths
z-score of , .
@ exp_sum_edge_lengths_planar
Expectation of constrained to planar arrangements, .
@ exp_sum_edge_lengths
Expectation of , .
@ var_sum_edge_lengths
Variance of , .
@ tree_caterpillar_distance
Caterpillar distance of the tree.
@ exp_sum_edge_lengths_projective
Expectation of constrained to projective arrangements, .
@ min_sum_edge_lengths_bipartite
Minimum sum of length of edges over bipartite arrangements.
@ flux_max_weight
Maximum flux weight.
@ min_sum_edge_lengths
Unconstrained minimum sum of length of edges.
@ sum_squared_out_degrees
Sum of squared out-degrees.
@ sum_hierarchical_distances
Sum of hierarchical distances of the tree.
@ flux_mean_left_span
Mean left span.
@ flux_min_WS_ratio
Minimum W/S ratio.
@ tree_diameter
Diameter of the tree.
@ flux_min_weight
Minimum flux weight.
@ max_sum_edge_lengths
Maximum sum of length of edges over all arrangements.
constexpr std::size_t treebank_feature_to_index(const io::treebank_feature_type &tf) noexcept
Returns the index of the input treebank feature.
Definition treebank_feature_type.hpp:639
Main namespace of the library.
Definition basic_types.hpp:48