Struct conllx::Sentence
[−]
[src]
pub struct Sentence { /* fields omitted */ }
A sentence with the CoNLL-X annotation layers.
This data type is a small wrapper around Vec<Token>
that provides some
extra convenience. For example, the implementation of the Display
trait
outputs the sentence in CoNLL-X format.
Methods
impl Sentence
[src]
fn new(tokens: Vec<Token>) -> Sentence
Create a new Sentence
from a vector of tokens.
fn as_tokens(&self) -> &[Token]
Get the sentence tokens as a slice.
fn as_tokens_mut(&mut self) -> &mut [Token]
Get the sentence tokens as a mutable slice.
fn iter(&self) -> Iter<Token>
Get an iterator over the sentence tokens.
fn iter_mut(&mut self) -> IterMut<Token>
Get a mutable iterator over the sentence tokens.
Trait Implementations
impl Clone for Sentence
[src]
fn clone(&self) -> Sentence
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Sentence
[src]
impl PartialEq for Sentence
[src]
fn eq(&self, __arg_0: &Sentence) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Sentence) -> bool
This method tests for !=
.
impl Display for Sentence
[src]
impl Index<usize> for Sentence
[src]
type Output = Token
The returned type after indexing
fn index(&self, index: usize) -> &Token
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Sentence
[src]
fn index_mut(&mut self, index: usize) -> &mut Token
The method for the mutable indexing (container[index]
) operation
impl IntoIterator for Sentence
[src]
type Item = Token
The type of the elements being iterated over.
type IntoIter = IntoIter<Token>
Which kind of iterator are we turning this into?
fn into_iter(self) -> IntoIter<Token>
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a Sentence
[src]
type Item = &'a Token
The type of the elements being iterated over.
type IntoIter = Iter<'a, Token>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a, Token>
Creates an iterator from a value. Read more