Struct conllx::Features
[−]
[src]
pub struct Features { /* fields omitted */ }
Token features.
In the CoNLL-X specification, these are morphological features of the token. Typically, the features are a list or a key-value mapping.
Methods
impl Features
[src]
fn from_string<S>(s: S) -> Self where
S: Into<String>,
S: Into<String>,
Create features from a string. The casual format uses key-value
pairs that are separated by a vertical bar (|
) and keys and
values using a colon (:
). Arbitrary strings will also be accepted,
however they will not give a nice feature-value mapping when using
as_map
.
fn as_map(&self) -> &BTreeMap<String, Option<String>>
Get the features field as a key-value mapping. This assumes that
the key-value pairs are separed using a vertical bar (|
) and keys
and values using a colon (:
). If the value is absent, corresponding
value in the mapping is None
.
The feature map is constructed lazily:
- If
as_map
is never called, the feature map is never created. - If
as_map
is called once or more, the feature map is only created once.
fn as_str(&self) -> &str
Get the features field.
Trait Implementations
impl Clone for Features
[src]
fn clone(&self) -> Self
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