|
|
constexpr | Treebank () noexcept=default |
| | Default constructor. Initializes an empty treebank.
|
|
constexpr | Treebank (const Treebank &) noexcept=delete |
| | Copy construction is disabled.
|
|
constexpr | Treebank (Treebank &&other) noexcept=delete |
| | Move construction is disabled.
|
|
constexpr const std::vector< std::string_view > & | columns () const noexcept |
| | Column names, in declaration order.
|
|
constexpr std::size_t | num_columns () const noexcept |
| | Number of columns in the treebank.
|
| constexpr std::optional< std::size_t > | get_column_pos (std::string_view name) const noexcept |
| | Looks up a column's position by name.
|
| constexpr std::optional< std::string_view > | get_column_name (std::size_t position) const noexcept |
| | Looks up a column's name by position.
|
| constexpr std::expected< std::size_t, std::error_code > | add_column (std::string_view name) noexcept |
| | Appends a new column, extending every existing token with an empty field for it.
|
| constexpr auto | sentences () const noexcept |
| | View over the sentences, in treebank order.
|
|
constexpr std::size_t | num_sentences () const noexcept |
| | Number of sentences in the treebank.
|
| constexpr std::expected< Sentence *, std::error_code > | add_sentence (std::string_view sent_id, std::string_view text=std::string_view()) noexcept |
| | Constructs and appends a new sentence.
|
| constexpr std::optional< Sentence * > | get_sentence_by_id (std::string_view sent_id) const noexcept |
| | Looks up a sentence by its identifier.
|
| constexpr std::error_code | remove_sentence (std::string_view sent_id) noexcept |
| | Removes the sentence with the given identifier.
|
| constexpr std::error_code | remove_sentence (const Sentence *sentence) noexcept |
| | Removes the given sentence.
|
|
constexpr bool | empty () const noexcept |
| | Whether the treebank contains no sentences.
|
|
constexpr void | clear () noexcept |
| | Removes all columns and sentences, resetting the treebank to its default-constructed state.
|
| constexpr std::error_code | validate () const noexcept |
| | Checks the treebank for structural inconsistencies.
|
|
constexpr Treebank & | operator= (Treebank &&other) noexcept=delete |
| | Move assignment is disabled.
|
|
constexpr Treebank & | operator= (const Treebank &) noexcept=delete |
| | Copy assignment is disabled.
|
|
constexpr | ~Treebank () noexcept=default |
| | Destructor.
|
In-memory representation of a CoNLL-U treebank.