udapi.block.read.conllu module

“Conllu is a reader block for the CoNLL-U files.

class udapi.block.read.conllu.Conllu(strict=False, empty_parent='warn', fix_cycles=False, **kwargs)[source]

Bases: BaseReader

A reader of the CoNLL-U files.

parse_comment_line(line, root)[source]

Parse one line of CoNLL-U and fill sent_id, text, newpar, newdoc in root.

read_tree()[source]

Load one (more) tree from self.filehandle and return its root.

This method must be overriden in all readers. Usually it is the only method that needs to be implemented. The implementation in this base clases raises NotImplementedError.

read_tree_from_lines(lines)[source]
read_trees()[source]

Load all trees from self.filehandle and return a list of their roots.

This method may be overriden in a reader if a faster alternative to read_tree() is needed. The implementation in this base clases raises NotImplementedError.