pub struct WorldState {
pub drs: Drs,
/* private fields */
}Expand description
The unified discourse state that persists across sentences.
Fields§
§drs: DrsThe global DRS (box hierarchy for scope tracking)
Implementations§
Source§impl WorldState
impl WorldState
pub fn new() -> WorldState
Sourcepub fn next_event_var(&mut self) -> String
pub fn next_event_var(&mut self) -> String
Generate next event variable (e1, e2, e3…)
Sourcepub fn event_history(&self) -> &[String]
pub fn event_history(&self) -> &[String]
Get event history for temporal ordering
Sourcepub fn next_reference_time(&mut self) -> String
pub fn next_reference_time(&mut self) -> String
Generate next reference time (r1, r2, r3…)
Sourcepub fn current_reference_time(&self) -> String
pub fn current_reference_time(&self) -> String
Get current reference time
Sourcepub fn add_time_constraint(
&mut self,
left: String,
relation: TimeRelation,
right: String,
)
pub fn add_time_constraint( &mut self, left: String, relation: TimeRelation, right: String, )
Add a temporal constraint
Sourcepub fn time_constraints(&self) -> &[TimeConstraint]
pub fn time_constraints(&self) -> &[TimeConstraint]
Get all time constraints
Sourcepub fn clear_time_constraints(&mut self)
pub fn clear_time_constraints(&mut self)
Clear time constraints (for sentence boundary reset if needed)
Sourcepub fn end_sentence(&mut self)
pub fn end_sentence(&mut self)
Mark a sentence boundary - collect telescope candidates
Sourcepub fn in_discourse_mode(&self) -> bool
pub fn in_discourse_mode(&self) -> bool
Check if we’re in discourse mode (multi-sentence context) In discourse mode, unresolved pronouns should error instead of deictic fallback
Sourcepub fn telescope_candidates(&self) -> &[TelescopeCandidate]
pub fn telescope_candidates(&self) -> &[TelescopeCandidate]
Get telescope candidates from previous sentence
Sourcepub fn resolve_via_telescope(
&mut self,
gender: Gender,
) -> Option<TelescopeCandidate>
pub fn resolve_via_telescope( &mut self, gender: Gender, ) -> Option<TelescopeCandidate>
Try to resolve a pronoun via telescoping
Sourcepub fn set_ownership(&mut self, noun_class: Symbol, state: OwnershipState)
pub fn set_ownership(&mut self, noun_class: Symbol, state: OwnershipState)
Set ownership state for a referent by noun class
Sourcepub fn get_ownership(&self, noun_class: Symbol) -> Option<OwnershipState>
pub fn get_ownership(&self, noun_class: Symbol) -> Option<OwnershipState>
Get ownership state for a referent by noun class
Sourcepub fn set_ownership_by_var(&mut self, var: Symbol, state: OwnershipState)
pub fn set_ownership_by_var(&mut self, var: Symbol, state: OwnershipState)
Set ownership state for a referent by variable name
Sourcepub fn get_ownership_by_var(&self, var: Symbol) -> Option<OwnershipState>
pub fn get_ownership_by_var(&self, var: Symbol) -> Option<OwnershipState>
Get ownership state for a referent by variable name
Sourcepub fn enter_modal_context(&mut self, is_epistemic: bool, force: f32)
pub fn enter_modal_context(&mut self, is_epistemic: bool, force: f32)
Enter a modal context (e.g., “might”, “would”, “could”)
Sourcepub fn exit_modal_context(&mut self)
pub fn exit_modal_context(&mut self)
Exit the current modal context
Sourcepub fn in_modal_context(&self) -> bool
pub fn in_modal_context(&self) -> bool
Check if we’re currently in a modal context
Sourcepub fn has_prior_modal_context(&self) -> bool
pub fn has_prior_modal_context(&self) -> bool
Check if there’s a prior modal context for subordination
Sourcepub fn can_subordinate(&self) -> bool
pub fn can_subordinate(&self) -> bool
Check if current modal can subordinate to prior context “would” can continue a “might” world
Trait Implementations§
Source§impl Clone for WorldState
impl Clone for WorldState
Source§fn clone(&self) -> WorldState
fn clone(&self) -> WorldState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorldState
impl Debug for WorldState
Source§impl Default for WorldState
impl Default for WorldState
Source§fn default() -> WorldState
fn default() -> WorldState
Auto Trait Implementations§
impl Freeze for WorldState
impl RefUnwindSafe for WorldState
impl Send for WorldState
impl Sync for WorldState
impl Unpin for WorldState
impl UnsafeUnpin for WorldState
impl UnwindSafe for WorldState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.