udapi.block.util.splitsentence module

Block util.SplitSentence will split a given sentence at a given token.

class udapi.block.util.splitsentence.SplitSentence(sent_id=None, word_id=None, misc_name=None, misc_value=None, **kwargs)[source]

Bases: Block

If the sent_id of the current sentence matches the parameter, splits the sentence into two. The first token of the second sentence is also given as a parameter.

Alternatively, a MISC attribute can be specified that triggers sentence splitting at the given token. With this approach, multiple sentence splits can be performed during one run.

make_zeros_roots(root)[source]

The steal_nodes() method does not make sure that all nodes newly attached to the artificial root have the ‘root’ relation. Fix it.

process_document(document)[source]

Process a UD document