pub struct DepGraphMut<'a> { /* private fields */ }Expand description
A mutable graph view.
This data structure provides a mutable view of a CoNLL-X 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§
Source§impl<'a> DepGraphMut<'a>
impl<'a> DepGraphMut<'a>
Sourcepub fn add_deprel<S>(&mut self, triple: DepTriple<S>)
pub fn add_deprel<S>(&mut self, triple: DepTriple<S>)
Add a dependency relation between head and dependent.
If dependent already has a head relation, this relation is removed
to ensure single-headedness.
Sourcepub fn dependents(&self, head: usize) -> impl Iterator<Item = DepTriple<&str>>
pub fn dependents(&self, head: usize) -> impl Iterator<Item = DepTriple<&str>>
Return an iterator over the dependents of head.
Sourcepub fn head(&self, dependent: usize) -> Option<DepTriple<&str>>
pub fn head(&self, dependent: usize) -> Option<DepTriple<&str>>
Return the head relation of dependent, if any.
Trait Implementations§
Source§impl<'a> Index<usize> for DepGraphMut<'a>
impl<'a> Index<usize> for DepGraphMut<'a>
Auto Trait Implementations§
impl<'a> !UnwindSafe for DepGraphMut<'a>
impl<'a> Freeze for DepGraphMut<'a>
impl<'a> RefUnwindSafe for DepGraphMut<'a>
impl<'a> Send for DepGraphMut<'a>
impl<'a> Sync for DepGraphMut<'a>
impl<'a> Unpin for DepGraphMut<'a>
impl<'a> UnsafeUnpin for DepGraphMut<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more