[−][src]Struct conllu::graph::DepGraph
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]
&self,
head: usize
) -> impl Iterator<Item = DepTriple<&'a str>>
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.
fn index(&self, idx: usize) -> &Self::Output
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,