53#include <lal/io/treebank_file_error.hpp>
54#include <lal/io/treebank_processor_base.hpp>
124 assert(n_threads != 0);
211 (
const std::string& main_file,
const std::string& output_directory)
300 const std::
string& treebank_collection_main_file,
301 const std::
string& output_directory,
302 const std::
size_t num_threads = 1
307 auto err = tbcolproc.
init(treebank_collection_main_file, output_directory);
308 if (not err.is_error()) {
return err; }
The processor base class.
Definition treebank_processor_base.hpp:61
Automatic processing of treebank collections.
Definition treebank_collection_processor.hpp:109
const treebank_file_error & get_error_type(const std::size_t i) const noexcept
Get the ith error.
Definition treebank_collection_processor.hpp:147
treebank_file_error join_all_files() const noexcept
Joins all resulting files into a single file.
const std::string & get_error_treebank_name(const std::size_t i) const noexcept
Get the treebank's name for where the ith error happened.
Definition treebank_collection_processor.hpp:175
std::vector< std::string > m_all_individual_treebank_ids
The list of names of the treebanks.
Definition treebank_collection_processor.hpp:251
const std::string & get_error_treebank_filename(const std::size_t i) const noexcept
Get the treebank's file name where the ith error happened.
Definition treebank_collection_processor.hpp:161
bool m_join_files
Join the files into a single file.
Definition treebank_collection_processor.hpp:255
void set_join_files(const bool v) noexcept
Join the resulting files into a single file.
Definition treebank_collection_processor.hpp:117
std::vector< std::tuple< treebank_file_error, std::string, std::string > > m_errors_from_processing
Set of errors resulting from processing the treebank collection.
Definition treebank_collection_processor.hpp:275
std::string m_treebank_column_name
Name of the column that identifies each treebank.
Definition treebank_collection_processor.hpp:257
treebank_file_error process() noexcept
Process the treebank collection.
std::size_t get_num_errors() const noexcept
Returns the number of errors that arised during processing.
Definition treebank_collection_processor.hpp:136
void set_treebank_column_name(const std::string &name) noexcept
Sets the name of the column used to group lines according to the treebank.
Definition treebank_collection_processor.hpp:195
std::string m_main_file
File containing the list of languages and their treebanks.
Definition treebank_collection_processor.hpp:280
std::string m_out_dir
Output directory.
Definition treebank_collection_processor.hpp:278
void set_number_threads(const std::size_t n_threads) noexcept
Set the number of threads.
Definition treebank_collection_processor.hpp:122
std::string m_join_to_file
The name of the file that joins all result files.
Definition treebank_collection_processor.hpp:253
void set_join_to_file_name(const std::string &join_to) noexcept
Sets the name of the file where all values are going to be stored.
Definition treebank_collection_processor.hpp:190
std::string m_column_join_name
The name of the column in the join file.
Definition treebank_collection_processor.hpp:261
std::size_t m_num_threads
Number of threads to use.
Definition treebank_collection_processor.hpp:259
treebank_file_error init(const std::string &main_file, const std::string &output_directory) noexcept
Initialize the processor with a new collection.
Treebank file error report class.
Definition treebank_file_error.hpp:64
treebank_file_error process_treebank_collection(const std::string &treebank_collection_main_file, const std::string &output_directory, const std::size_t num_threads=1) noexcept
Automatically process a treebank collection.
Definition treebank_collection_processor.hpp:299
Main namespace of the library.
Definition basic_types.hpp:48