pub enum SlotRecognizer {
Integer,
IntegerNear(Vec<String>),
Money,
Regex(String),
OneOf(Vec<String>),
Fuzzy(Vec<String>),
YesNo,
DateTime,
}Expand description
A serializable description of the deterministic recognizer that fills a slot.
Mirrors Recognizer but is serde-friendly (it holds patterns/options as
data, not a compiled Regex), so a FrameSpec — and the conversation spec
that embeds it — round-trips through JSON/YAML. Lower to a runtime recognizer
with SlotRecognizer::to_recognizer.
Variants§
Integer
First integer in the text.
IntegerNear(Vec<String>)
First integer, but only when one of these anchor words is present.
Money
A monetary amount.
Regex(String)
First capture (or whole match) of this regex pattern.
OneOf(Vec<String>)
The first of these options to appear (case-insensitive substring).
Fuzzy(Vec<String>)
The best Jaro-Winkler match among these options.
YesNo
Affirmative/negative → boolean.
DateTime
A calendar/clock expression → a JSON object.
Implementations§
Source§impl SlotRecognizer
impl SlotRecognizer
Sourcepub fn to_recognizer(&self) -> Recognizer
pub fn to_recognizer(&self) -> Recognizer
Lower to a runtime Recognizer.
Trait Implementations§
Source§impl Clone for SlotRecognizer
impl Clone for SlotRecognizer
Source§fn clone(&self) -> SlotRecognizer
fn clone(&self) -> SlotRecognizer
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 Debug for SlotRecognizer
impl Debug for SlotRecognizer
Source§impl<'de> Deserialize<'de> for SlotRecognizer
impl<'de> Deserialize<'de> for SlotRecognizer
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 SlotRecognizer
impl PartialEq for SlotRecognizer
Source§impl Serialize for SlotRecognizer
impl Serialize for SlotRecognizer
impl StructuralPartialEq for SlotRecognizer
Auto Trait Implementations§
impl Freeze for SlotRecognizer
impl RefUnwindSafe for SlotRecognizer
impl Send for SlotRecognizer
impl Sync for SlotRecognizer
impl Unpin for SlotRecognizer
impl UnwindSafe for SlotRecognizer
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