pub enum TemporalExpressionType {
Absolute,
Relative {
offset_days: i32,
anchor: Option<Box<DateTime<Utc>>>,
},
EventAnchored {
event: String,
relation: TemporalRelation,
},
Recurring {
pattern: String,
frequency: Option<RecurrenceFrequency>,
},
Fuzzy {
direction: FuzzyDirection,
approximate_days: Option<(i32, i32)>,
},
Partial {
specified: PartialTimeComponents,
},
}Expand description
Type of temporal expression based on how it relates to absolute time.
┌─────────────────────────────────────────────────────────────────────┐
│ TEMPORAL EXPRESSION TYPES │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Absolute: "January 15, 2024" → directly mappable │
│ Relative: "yesterday", "next week" → needs document date │
│ Anchored: "before the war" → needs event reference │
│ Recurring: "every Monday" → pattern, not single point │
│ Fuzzy: "recently", "soon" → vague, probabilistic │
│ Partial: "in the morning" → missing date component │
│ │
└─────────────────────────────────────────────────────────────────────┘Variants§
Absolute
Directly maps to calendar time: “2024-01-15”, “January 2024”
Relative
Relative to document/utterance time: “yesterday”, “next week”, “3 days ago”
Fields
EventAnchored
Anchored to an event rather than calendar: “before the war”, “after graduation”
Fields
§
relation: TemporalRelationTemporal relation to the event
Recurring
Recurring pattern: “every Monday”, “annually”, “on weekends”
Fields
§
frequency: Option<RecurrenceFrequency>Frequency (if extractable)
Fuzzy
Fuzzy/vague: “recently”, “soon”, “in the past”, “long ago”
Fields
§
direction: FuzzyDirectionDirection (past/future/unknown)
Partial
Partial specification: “in the morning”, “on Tuesday” (missing year/date)
Fields
§
specified: PartialTimeComponentsWhat components are specified
Trait Implementations§
Source§impl Clone for TemporalExpressionType
impl Clone for TemporalExpressionType
Source§fn clone(&self) -> TemporalExpressionType
fn clone(&self) -> TemporalExpressionType
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 TemporalExpressionType
impl Debug for TemporalExpressionType
Source§impl<'de> Deserialize<'de> for TemporalExpressionType
impl<'de> Deserialize<'de> for TemporalExpressionType
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 TemporalExpressionType
impl PartialEq for TemporalExpressionType
Source§impl Serialize for TemporalExpressionType
impl Serialize for TemporalExpressionType
impl Eq for TemporalExpressionType
impl StructuralPartialEq for TemporalExpressionType
Auto Trait Implementations§
impl Freeze for TemporalExpressionType
impl RefUnwindSafe for TemporalExpressionType
impl Send for TemporalExpressionType
impl Sync for TemporalExpressionType
impl Unpin for TemporalExpressionType
impl UnsafeUnpin for TemporalExpressionType
impl UnwindSafe for TemporalExpressionType
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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