pub struct DepGraphMut<'a> { /* private fields */ }
Expand description

A mutable graph view.

This data structure provides a mutable view of a CoNLL-U dependency graph. The view can be used to retrieve the dependents of a head or the head of a dependent. In addition, the add_deprel method can be used to add dependency relations to the graph.

Implementations

Add a dependency relation between head and dependent.

If dependent already has a head relation, this relation is removed to ensure single-headedness.

Return an iterator over the dependents of head.

Return the head relation of dependent, if any.

Remove relation of a token to its head.

Returns the index of the head iff a head was removed.

Get the number of nodes in the dependency graph.

This is equal to the number of tokens, plus one root node.

Trait Implementations

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.