pub trait LogicVerbParsing<'a, 'ctx, 'int> {
// Required methods
fn parse_predicate_with_subject(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>;
fn parse_predicate_with_subject_as_var(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>;
fn try_parse_plural_subject(
&mut self,
first_subject: &NounPhrase<'a>,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>;
fn parse_control_structure(
&mut self,
subject: &NounPhrase<'a>,
verb: Symbol,
verb_time: Time,
) -> Result<&'a LogicExpr<'a>, ParseError>;
fn is_control_verb(&self, verb: Symbol) -> bool;
fn build_group_predicate(
&mut self,
subjects: &[Symbol],
verb: Symbol,
verb_time: Time,
) -> &'a LogicExpr<'a>;
fn build_group_transitive(
&mut self,
subjects: &[Symbol],
objects: &[Symbol],
verb: Symbol,
verb_time: Time,
) -> &'a LogicExpr<'a>;
}Expand description
Trait for parsing verb phrases in declarative (logic) mode.
Provides methods for parsing predicates with subjects, control verbs, and plural/group constructions with Neo-Davidsonian event semantics.
Required Methods§
Sourcefn parse_predicate_with_subject(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_predicate_with_subject( &mut self, subject_symbol: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Parses a verb phrase given the subject as a constant symbol.
Sourcefn parse_predicate_with_subject_as_var(
&mut self,
subject_symbol: Symbol,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_predicate_with_subject_as_var( &mut self, subject_symbol: Symbol, ) -> Result<&'a LogicExpr<'a>, ParseError>
Parses a verb phrase with subject as a bound variable.
Sourcefn try_parse_plural_subject(
&mut self,
first_subject: &NounPhrase<'a>,
) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
fn try_parse_plural_subject( &mut self, first_subject: &NounPhrase<'a>, ) -> Result<Option<&'a LogicExpr<'a>>, ParseError>
Attempts to parse a plural subject (“John and Mary verb”).
Returns Ok(Some(expr)) on success, Ok(None) if not plural, Err on semantic error.
Sourcefn parse_control_structure(
&mut self,
subject: &NounPhrase<'a>,
verb: Symbol,
verb_time: Time,
) -> Result<&'a LogicExpr<'a>, ParseError>
fn parse_control_structure( &mut self, subject: &NounPhrase<'a>, verb: Symbol, verb_time: Time, ) -> Result<&'a LogicExpr<'a>, ParseError>
Parses control verb structures: “wants to VP”, “persuaded X to VP”.
Sourcefn is_control_verb(&self, verb: Symbol) -> bool
fn is_control_verb(&self, verb: Symbol) -> bool
Checks if a verb is a control verb (want, try, persuade, etc.).