CoNLL-U
Loading...
Searching...
No Matches
CoNLL-U

Classes

class  tg::conllu::ErrorCategory
 The std::error_category implementation backing tg::conllu::ErrorCode. More...
struct  tg::conllu::ParserOptions
 Configuration options controlling how a Parser interprets CoNLL-U input. More...
class  tg::conllu::Parser
 Parses CoNLL-U formatted input into a Treebank. More...
class  tg::conllu::Sentence
 A single sentence within a Treebank. More...
class  tg::conllu::Token
 A single token within a Sentence, or an empty node within a Token. More...
class  tg::conllu::Treebank
 In-memory representation of a CoNLL-U treebank. More...
class  tg::conllu::Word
 A multiword token: a contiguous span of two or more Tokens sharing a single surface form. More...
struct  tg::conllu::WriterOptions
 Configuration options controlling how a Writer serializes a Treebank. More...
class  tg::conllu::Writer
 Serializes a Treebank into CoNLL-U formatted output. More...

Typedefs

using tg::conllu::TokenId = std::uint64_t
 Identifier for a token or empty node within a sentence.

Enumerations

enum class  tg::conllu::ErrorCode : int {
  ErrorCode::Success = int{0} , ErrorCode::StreamError , ErrorCode::InsufficientMemory , ErrorCode::PositionOutOfRange ,
  ErrorCode::InvalidPointer , ErrorCode::InvalidColumnsLine , ErrorCode::InvalidColumnName , ErrorCode::DuplicateColumnName ,
  ErrorCode::ColumnNotFound , ErrorCode::SentenceMustStartWithMetaLine , ErrorCode::InvalidSentenceMetaLine , ErrorCode::InvalidSentenceMetaKey ,
  ErrorCode::DuplicateSentenceMetaEntry , ErrorCode::MissingSentenceId , ErrorCode::InvalidSentenceId , ErrorCode::DuplicateSentenceId ,
  ErrorCode::SentenceIdCannotBeRemoved , ErrorCode::SentenceNotFoundInTreebank , ErrorCode::InvalidTokenId , ErrorCode::TokenFieldCountMismatch ,
  ErrorCode::ImmutableTokenField , ErrorCode::TokenEmptyNodeMismatch , ErrorCode::NodeNotFoundInToken , ErrorCode::InvalidTokenHead ,
  ErrorCode::TokenNotFoundInSentence , ErrorCode::InvalidNumberOfFields , ErrorCode::InvalidWordRange , ErrorCode::OverlappingWordRange ,
  ErrorCode::WordNotFoundInSentence , ErrorCode::WordMustAppearBeforeToken , ErrorCode::InvalidWordFieldValue
}
 Error codes reported by parsing, writing, and treebank mutation operations. More...

Detailed Description

Enumeration Type Documentation

◆ ErrorCode

enum class tg::conllu::ErrorCode : int
strong

Error codes reported by parsing, writing, and treebank mutation operations.

Enumerator
Success 

No error.

StreamError 

Reading from or writing to the underlying stream failed (e.g. an exception was thrown while buffering input).

InsufficientMemory 

An allocation failed (e.g. while growing a container or copying a string).

PositionOutOfRange 

A supplied index or position was out of range for the target container.

InvalidPointer 

A required pointer argument was null, or did not belong to the expected owner.

InvalidColumnsLine 

Reserved for a malformed column declaration line.

InvalidColumnName 

A column name failed validation (e.g. empty or containing disallowed characters).

DuplicateColumnName 

A column with the given name already exists in the treebank.

ColumnNotFound 

No column with the given name or position exists.

SentenceMustStartWithMetaLine 

The first line of a sentence block was not a #-prefixed meta line.

InvalidSentenceMetaLine 

A #-prefixed meta line is not a comment line (does not start with #).

InvalidSentenceMetaKey 

An empty metadata key was supplied.

DuplicateSentenceMetaEntry 

The same metadata key was set more than once for a sentence.

MissingSentenceId 

A sentence block had no sent_id meta line.

InvalidSentenceId 

A sentence identifier failed validation.

DuplicateSentenceId 

A sentence with the given identifier already exists in the treebank.

SentenceIdCannotBeRemoved 

An attempt was made to remove the reserved sent_id metadata entry.

SentenceNotFoundInTreebank 

No sentence with the given identifier or pointer exists in the treebank.

InvalidTokenId 

A token identifier (ID field) failed validation.

TokenFieldCountMismatch 

A token line's number of fields does not match the treebank's column count.

ImmutableTokenField 

An attempt was made to modify a field that cannot be set directly (e.g. ID).

TokenEmptyNodeMismatch 

An empty node's identifier is inconsistent with its parent token.

NodeNotFoundInToken 

No empty node with the given identifier or pointer exists on the token.

InvalidTokenHead 

A HEAD value failed validation (e.g. self-reference or no matching token).

TokenNotFoundInSentence 

No token with the given identifier or pointer exists in the sentence.

InvalidNumberOfFields 

A token's number of fields does not match what the treebank expects.

InvalidWordRange 

A word's token range is malformed or out of bounds for its sentence.

OverlappingWordRange 

A word's token range overlaps another word's range in the same sentence.

WordNotFoundInSentence 

No word with the given pointer exists in the sentence.

WordMustAppearBeforeToken 

A word line appeared after one of the individual token lines it should span; word lines must precede their constituent tokens.

InvalidWordFieldValue 

A word line set a field it is not permitted to carry (only ID, FORM, MISC, and a Typo=Yes FEATS flag are allowed on a word line).