Drs

Struct Drs 

Source
pub struct Drs { /* private fields */ }

Implementations§

Source§

impl Drs

Source

pub fn new() -> Self

Source

pub fn enter_box(&mut self, box_type: BoxType) -> usize

Source

pub fn exit_box(&mut self)

Source

pub fn current_box_index(&self) -> usize

Source

pub fn current_box_type(&self) -> Option<BoxType>

Source

pub fn introduce_referent( &mut self, variable: Symbol, noun_class: Symbol, gender: Gender, number: Number, )

Source

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”)

Source

pub fn introduce_proper_name( &mut self, variable: Symbol, name: Symbol, gender: Gender, )

Source

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

Source

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

Source

pub fn resolve_definite( &self, from_box: usize, noun_class: Symbol, ) -> Option<Symbol>

Resolve a definite description by finding accessible referent matching noun class

Source

pub fn has_referent_by_variable(&self, var: Symbol) -> bool

Check if a referent exists by variable name (for imperative mode variable validation)

Source

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.

Source

pub fn get_universal_referents(&self) -> Vec<Symbol>

Get all referents that should receive universal quantification

Source

pub fn get_existential_referents(&self) -> Vec<Symbol>

Get all referents that should receive existential quantification

Source

pub fn get_last_event_referent(&self, interner: &Interner) -> Option<Symbol>

Get the most recent event referent (for binding weather adjectives to events)

Source

pub fn in_conditional_antecedent(&self) -> bool

Check if we’re currently in a conditional antecedent

Source

pub fn in_universal_restrictor(&self) -> bool

Check if we’re currently in a universal restrictor

Source

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.

Source

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.

Source

pub fn set_ownership(&mut self, noun_class: Symbol, state: OwnershipState)

Set ownership state for a referent by noun class

Source

pub fn set_ownership_by_var(&mut self, var: Symbol, state: OwnershipState)

Set ownership state for a referent by variable name

Source

pub fn get_ownership(&self, noun_class: Symbol) -> Option<OwnershipState>

Get ownership state for a referent by noun class

Source

pub fn get_ownership_by_var(&self, var: Symbol) -> Option<OwnershipState>

Get ownership state for a referent by variable name

Source

pub fn clear(&mut self)

Trait Implementations§

Source§

impl Clone for Drs

Source§

fn clone(&self) -> Drs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Drs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Drs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Drs

§

impl RefUnwindSafe for Drs

§

impl Send for Drs

§

impl Sync for Drs

§

impl Unpin for Drs

§

impl UnwindSafe for Drs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V