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() -> Self
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more