#[non_exhaustive]pub struct UnderstandingExpectation {
pub units: Vec<UnitExpectation>,
}Expand description
The units a message splits into, in message order.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.units: Vec<UnitExpectation>Every unit the message carries, in the order the user wrote them.
Implementations§
Source§impl UnderstandingExpectation
impl UnderstandingExpectation
Sourcepub fn validate(&self, text: Option<&str>) -> Result<(), CorpusError>
pub fn validate(&self, text: Option<&str>) -> Result<(), CorpusError>
Checks each unit against the turn text it is about.
§Errors
CorpusError::Invalid when a unit quotes words the turn does not contain,
names an operation its kind cannot reach, or states an argument both ways.
Source§impl UnderstandingExpectation
impl UnderstandingExpectation
Sourcepub fn score(&self, text: &str, observed: &Observation) -> TaskScores
pub fn score(&self, text: &str, observed: &Observation) -> TaskScores
Scores the understanding a turn recorded against what this item expects of each task. A unit is paired with the understood unit quoting the same words, else with the one at the same position.
Trait Implementations§
Source§impl Clone for UnderstandingExpectation
impl Clone for UnderstandingExpectation
Source§impl Debug for UnderstandingExpectation
impl Debug for UnderstandingExpectation
Source§impl Default for UnderstandingExpectation
impl Default for UnderstandingExpectation
Source§impl<'de> Deserialize<'de> for UnderstandingExpectation
impl<'de> Deserialize<'de> for UnderstandingExpectation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UnderstandingExpectation
impl PartialEq for UnderstandingExpectation
Source§impl Serialize for UnderstandingExpectation
impl Serialize for UnderstandingExpectation
impl StructuralPartialEq for UnderstandingExpectation
Auto Trait Implementations§
impl Freeze for UnderstandingExpectation
impl RefUnwindSafe for UnderstandingExpectation
impl Send for UnderstandingExpectation
impl Sync for UnderstandingExpectation
impl Unpin for UnderstandingExpectation
impl UnsafeUnpin for UnderstandingExpectation
impl UnwindSafe for UnderstandingExpectation
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