52#include <lal/linear_arrangement.hpp>
53#include <lal/io/treebank_error.hpp>
54#include <lal/io/process_treebank_base.hpp>
117 const std::string& treebank_input_file,
118 const std::string& output_file,
119 const std::string& treebank_id =
""
144 template <class TREE, class OUT_STREAM>
146 (const TREE& rT,
double *props,
char *prop_set, OUT_STREAM& out_lab_file)
152 template <class OUT_STREAM>
154 (OUT_STREAM& out_lab_file)
158 template <class OUT_STREAM>
160 (OUT_STREAM& out_lab_file)
166 template <class TREE_TYPE, class OUT_STREAM>
168 (TREE_TYPE& t, OUT_STREAM& out_lab_file)
172 template <class TREE_TYPE, class OUT_STREAM>
174 (const TREE_TYPE& t, uint64_t C, OUT_STREAM& out_lab_file)
253(const std::
string& treebank_file, const std::
string& output_file)
257 auto err = tbproc.
init(treebank_file, output_file);
The processor base class.
Definition: process_treebank_base.hpp:61
Treebank error report class.
Definition: treebank_error.hpp:64
Automatic processing of treebank files.
Definition: treebank_processor.hpp:103
std::string m_treebank_filename
File containing the list of languages and their treebanks.
Definition: treebank_processor.hpp:179
std::string m_treebank_id
Treebank identifier.
Definition: treebank_processor.hpp:183
void output_tree_type_values(TREE_TYPE &t, OUT_STREAM &out_lab_file) const noexcept
Output the values for the tree types.
treebank_error process() noexcept
Process the treebank file.
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 process_tree(const TREE &rT, double *props, char *prop_set, OUT_STREAM &out_lab_file) noexcept
Process a single tree in a treebank.
treebank_error init(const std::string &treebank_input_file, const std::string &output_file, const std::string &treebank_id="") noexcept
Initialise the processor with a new collection.
void output_syndepstruct_type_values(const TREE_TYPE &t, uint64_t C, OUT_STREAM &out_lab_file) const noexcept
Output the values for the syntactic dependency tree types.
std::string m_output_file
Output directory.
Definition: treebank_processor.hpp:181
treebank_feature
The features that can be computed in automatic processing of treebanks.
Definition: treebank_feature.hpp:68
@ exp_num_crossings
First moment of expectation of , .
@ flux_min_size
Minimum flux size.
@ 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 planary constraint.
@ flux_mean_RL_ratio
Mean R/L ratio.
@ flux_max_size
Maximum flux size.
@ 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 planary 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.
@ 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 planary 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 planary 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, .
@ 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.
@ no_error
No error occurred.
treebank_error process_treebank(const std::string &treebank_file, const std::string &output_file) noexcept
Automatically process a treebank.
Definition: treebank_processor.hpp:253
constexpr std::size_t treebank_feature_to_index(const io::treebank_feature &tf) noexcept
Returns the index of the input treebank feature.
Definition: treebank_feature.hpp:603
Main namespace of the library.
Definition: basic_types.hpp:50