[][src]Struct conllu::graph::DepGraph

pub struct DepGraph<'a> { /* fields omitted */ }

A graph view.

This data structure provides a 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.

Methods

impl<'a> DepGraph<'a>[src]

pub fn dependents(
    &self,
    head: usize
) -> impl Iterator<Item = DepTriple<&'a str>>
[src]

Return an iterator over the dependents of head.

pub fn head(&self, dependent: usize) -> Option<DepTriple<&'a str>>[src]

Return the head relation of dependent, if any.

pub fn len(&self) -> usize[src]

Get the number of nodes in the dependency graph.

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

Trait Implementations

impl<'a> Eq for DepGraph<'a>[src]

impl<'a> Index<usize> for DepGraph<'a>[src]

type Output = Node

The returned type after indexing.

impl<'a, 'b> PartialEq<DepGraph<'b>> for DepGraph<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for DepGraph<'a>

impl<'a> Send for DepGraph<'a>

impl<'a> Sync for DepGraph<'a>

impl<'a> Unpin for DepGraph<'a>

impl<'a> UnwindSafe for DepGraph<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.