The processor base class.
More...
#include <treebank_processor_base.hpp>
|
void | add_feature (const treebank_feature_type &fs) noexcept |
| Adds a feature to the processor.
|
|
void | remove_feature (const treebank_feature_type &fs) noexcept |
| Removes a feature from the processor.
|
|
void | set_check_before_process (const bool v) noexcept |
| Should the treebank file or collection be checked for errors prior to processing?
|
|
void | clear_features () noexcept |
| Clear the features in the processor.
|
|
void | set_separator (const char c) noexcept |
| Sets the separator character.
|
|
void | set_verbosity (const int k) noexcept |
| Sets the level of verbosity of the process methods.
|
|
void | set_output_header (const bool h) noexcept |
| Output a hedaer for the treebank result file.
|
|
void | set_column_name (const treebank_feature_type &tf, const std::string &name) noexcept |
| Sets a custom name for the column corresponding to a given feature.
|
|
bool | has_feature (const treebank_feature_type &fs) const noexcept |
| Is a given feature to be calculated?
|
|
|
void | initialize_column_names () noexcept |
| Initializes column names m_column_names.
|
|
|
std::array< std::string, __treebank_feature_size > | m_column_names |
| String for each column.
|
|
std::array< bool, __treebank_feature_size > | m_what_fs |
| The list of features to be computed.
|
|
bool | m_check_before_process = true |
| Process the treebank file or collection prior to processing.
|
|
char | m_separator = '\t' |
| Character used as separator.
|
|
bool | m_output_header = true |
| Output a header for each file.
|
|
int | m_be_verbose = 0 |
| The verbosity of the processor.
|
|
The processor base class.
Users should refrain from using this class. This class acts as a base class for all processor classes, namely, the lal::io::treebank_processor and the lal::io::treebank_collection_processor.
◆ add_feature()
Adds a feature to the processor.
- Parameters
-
◆ has_feature()
Is a given feature to be calculated?
- Parameters
-
fs | The feature being queried. |
- Returns
- True or False depending on whether the feature was added or removed.
◆ remove_feature()
Removes a feature from the processor.
- Parameters
-
◆ set_column_name()
void lal::io::_treebank_processor_base::set_column_name |
( |
const treebank_feature_type & | tf, |
|
|
const std::string & | name ) |
|
inlinenoexcept |
Sets a custom name for the column corresponding to a given feature.
This does not work for features
◆ set_output_header()
void lal::io::_treebank_processor_base::set_output_header |
( |
const bool | h | ) |
|
|
inlinenoexcept |
Output a hedaer for the treebank result file.
Default is true.
- Parameters
-
◆ set_separator()
void lal::io::_treebank_processor_base::set_separator |
( |
const char | c | ) |
|
|
inlinenoexcept |
Sets the separator character.
The default seprator is a tabulator character '\t'.
- Parameters
-
c | The separator character. |
◆ set_verbosity()
void lal::io::_treebank_processor_base::set_verbosity |
( |
const int | k | ) |
|
|
inlinenoexcept |
Sets the level of verbosity of the process methods.
Default is 0 (i.e., no verbosity at all). Verbosity is classified by levels:
- Level 1: outputs progress messages.
- Level 2: outputs error messages.
- Parameters
-
◆ m_be_verbose
int lal::io::_treebank_processor_base::m_be_verbose = 0 |
|
protected |
The verbosity of the processor.
When set to a value greater than or equal to 1, method process will output progress messages.
The documentation for this class was generated from the following file: