pub struct ScenarioDataset<'a> { /* private fields */ }Expand description
A struct defining a dataset of different Scenarios as well as their associated sentences all
lemmas in the dataset.
Implementations§
Source§impl<'a> ScenarioDataset<'a>
impl<'a> ScenarioDataset<'a>
Sourcepub fn new(
scenarios: Vec<Scenario<'a>>,
sentences: Vec<Vec<&'a str>>,
lemmas: HashSet<&'a str>,
) -> Result<Self, DatasetError>
pub fn new( scenarios: Vec<Scenario<'a>>, sentences: Vec<Vec<&'a str>>, lemmas: HashSet<&'a str>, ) -> Result<Self, DatasetError>
Create a new ScenarioDataset
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of scenarios in the ScenarioDataset.
Sourcepub fn iter_scenarios_mut(&mut self) -> impl Iterator<Item = &mut Scenario<'a>>
pub fn iter_scenarios_mut(&mut self) -> impl Iterator<Item = &mut Scenario<'a>>
Iterate over all scenarios with a mutable reference.
Sourcepub fn iter_scenarios(&self) -> impl Iterator<Item = &Scenario<'a>>
pub fn iter_scenarios(&self) -> impl Iterator<Item = &Scenario<'a>>
Iterate over all scenarios
Sourcepub fn iter_mut(
&mut self,
) -> impl Iterator<Item = (&mut Scenario<'a>, &mut Vec<&'a str>)>
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&mut Scenario<'a>, &mut Vec<&'a str>)>
Iterate over all scenarios and sentences with a mutable reference.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&Scenario<'a>, &Vec<&'a str>)>
pub fn iter(&self) -> impl Iterator<Item = (&Scenario<'a>, &Vec<&'a str>)>
Iterate over all scenarios and sentences
Sourcepub fn parse(s: &'a str) -> Result<Self, LambdaParseError>
pub fn parse(s: &'a str) -> Result<Self, LambdaParseError>
Parse a list of sentences and scenarios and return the dataset.
Trait Implementations§
Source§impl<'a> Clone for ScenarioDataset<'a>
impl<'a> Clone for ScenarioDataset<'a>
Source§fn clone(&self) -> ScenarioDataset<'a>
fn clone(&self) -> ScenarioDataset<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ScenarioDataset<'a>
impl<'a> Debug for ScenarioDataset<'a>
Source§impl<'a> Default for ScenarioDataset<'a>
impl<'a> Default for ScenarioDataset<'a>
Source§fn default() -> ScenarioDataset<'a>
fn default() -> ScenarioDataset<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> PartialEq for ScenarioDataset<'a>
impl<'a> PartialEq for ScenarioDataset<'a>
impl<'a> Eq for ScenarioDataset<'a>
impl<'a> StructuralPartialEq for ScenarioDataset<'a>
Auto Trait Implementations§
impl<'a> Freeze for ScenarioDataset<'a>
impl<'a> RefUnwindSafe for ScenarioDataset<'a>
impl<'a> Send for ScenarioDataset<'a>
impl<'a> Sync for ScenarioDataset<'a>
impl<'a> Unpin for ScenarioDataset<'a>
impl<'a> UnwindSafe for ScenarioDataset<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].