|
|
constexpr | Word () noexcept=delete |
| | Default construction is disabled; words are created via Sentence::add_word.
|
| constexpr std::error_code | set_range (Range range) noexcept |
| | Sets the token range covered by this word.
|
| constexpr std::error_code | set_range (TokenId first, TokenId last) noexcept |
| | Sets the token range covered by this word.
|
|
constexpr TokenId | first_id () const noexcept |
| | Identifier of the first token in the word's range.
|
|
constexpr TokenId | last_id () const noexcept |
| | Identifier of the last token in the word's range.
|
|
constexpr std::optional< std::string_view > | get_form () const noexcept |
| | Word form (surface form of the multiword token).
|
| constexpr std::error_code | set_form (const std::optional< std::string_view > &form) noexcept |
| | Sets the word form.
|
|
constexpr void | unset_form () noexcept |
| | Unsets the word form.
|
|
constexpr std::optional< std::string_view > | get_misc () const noexcept |
| | Word-level MISC field.
|
| constexpr std::error_code | set_misc (const std::optional< std::string_view > &misc) noexcept |
| | Sets the word-level MISC field.
|
|
constexpr void | unset_misc () noexcept |
| | Unsets the word-level MISC field.
|
|
constexpr std::optional< bool > | get_typo () const noexcept |
| | Whether the word is flagged as a typo.
|
| constexpr void | set_typo (std::optional< bool > typo) noexcept |
| | Sets whether the word is flagged as a typo.
|
|
constexpr void | unset_typo () noexcept |
| | Unsets the typo flag.
|
|
constexpr auto | tokens () const noexcept |
| | View over the tokens covered by this word, in sentence order.
|
|
constexpr std::size_t | num_tokens () const noexcept |
| | Number of tokens covered by this word.
|
| constexpr bool | contains_token (Token *token) const noexcept |
| | Checks whether a token belongs to this word.
|
| constexpr bool | contains_token_id (TokenId id) const noexcept |
| | Checks whether a token identifier belongs to this word.
|
| constexpr std::error_code | validate () const noexcept |
| | Checks the word for structural inconsistencies.
|
|
constexpr | ~Word () noexcept=default |
| | Destructor.
|
A multiword token: a contiguous span of two or more Tokens sharing a single surface form.