pub struct Drs { /* private fields */ }Implementations§
Source§impl Drs
impl Drs
pub fn new() -> Self
pub fn enter_box(&mut self, box_type: BoxType) -> usize
pub fn exit_box(&mut self)
pub fn current_box_index(&self) -> usize
pub fn current_box_type(&self) -> Option<BoxType>
pub fn introduce_referent( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, )
Sourcepub fn introduce_referent_with_source(
&mut self,
variable: Symbol,
noun_class: Symbol,
gender: Gender,
number: Number,
source: ReferentSource,
)
pub fn introduce_referent_with_source( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, source: ReferentSource, )
Introduce a referent with an explicit source (used for negative quantifiers like “No X”)
pub fn introduce_proper_name( &mut self, variable: Symbol, name: Symbol, gender: Gender, )
Sourcepub fn is_accessible(&self, target_box: usize, from_box: usize) -> bool
pub fn is_accessible(&self, target_box: usize, from_box: usize) -> bool
Check if a referent in box from_box can access referents in box target_box
Sourcepub fn resolve_pronoun(
&mut self,
from_box: usize,
gender: Gender,
number: Number,
) -> Result<Symbol, ScopeError>
pub fn resolve_pronoun( &mut self, from_box: usize, gender: Gender, number: Number, ) -> Result<Symbol, ScopeError>
Resolve a pronoun by finding accessible referents matching gender and number
Sourcepub fn resolve_definite(
&self,
from_box: usize,
noun_class: Symbol,
) -> Option<Symbol>
pub fn resolve_definite( &self, from_box: usize, noun_class: Symbol, ) -> Option<Symbol>
Resolve a definite description by finding accessible referent matching noun class
Sourcepub fn has_referent_by_variable(&self, var: Symbol) -> bool
pub fn has_referent_by_variable(&self, var: Symbol) -> bool
Check if a referent exists by variable name (for imperative mode variable validation)
Sourcepub fn resolve_bridging(
&self,
interner: &Interner,
noun_class: Symbol,
) -> Option<(Symbol, &'static str)>
pub fn resolve_bridging( &self, interner: &Interner, noun_class: Symbol, ) -> Option<(Symbol, &'static str)>
Resolve bridging anaphora by finding referents whose type contains the noun as a part. Returns matching referent and whole name for PartOf relation.
Sourcepub fn get_universal_referents(&self) -> Vec<Symbol>
pub fn get_universal_referents(&self) -> Vec<Symbol>
Get all referents that should receive universal quantification
Sourcepub fn get_existential_referents(&self) -> Vec<Symbol>
pub fn get_existential_referents(&self) -> Vec<Symbol>
Get all referents that should receive existential quantification
Sourcepub fn get_last_event_referent(&self, interner: &Interner) -> Option<Symbol>
pub fn get_last_event_referent(&self, interner: &Interner) -> Option<Symbol>
Get the most recent event referent (for binding weather adjectives to events)
Sourcepub fn in_conditional_antecedent(&self) -> bool
pub fn in_conditional_antecedent(&self) -> bool
Check if we’re currently in a conditional antecedent
Sourcepub fn in_universal_restrictor(&self) -> bool
pub fn in_universal_restrictor(&self) -> bool
Check if we’re currently in a universal restrictor
Sourcepub fn get_telescope_candidates(&self) -> Vec<TelescopeCandidate>
pub fn get_telescope_candidates(&self) -> Vec<TelescopeCandidate>
Get all referents that can telescope across sentence boundaries. Only includes referents from boxes where can_telescope() is true. Excludes referents blocked by negation or disjunction.
Sourcepub fn find_blocked_referent(
&self,
from_box: usize,
gender: Gender,
) -> Option<(Symbol, BoxType)>
pub fn find_blocked_referent( &self, from_box: usize, gender: Gender, ) -> Option<(Symbol, BoxType)>
Find a referent that matches but is blocked by scope. Used to generate informative error messages.
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 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(&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 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