NounParsing

Trait NounParsing 

Source
pub trait NounParsing<'a, 'ctx, 'int> {
    // Required methods
    fn parse_noun_phrase(
        &mut self,
        greedy: bool,
    ) -> Result<NounPhrase<'a>, ParseError>;
    fn parse_noun_phrase_for_relative(
        &mut self,
    ) -> Result<NounPhrase<'a>, ParseError>;
    fn noun_phrase_to_term(&self, np: &NounPhrase<'a>) -> Term<'a>;
    fn check_possessive(&self) -> bool;
    fn check_of_preposition(&self) -> bool;
    fn check_proper_name_or_label(&self) -> bool;
    fn check_possessive_pronoun(&self) -> bool;
}
Expand description

Trait for parsing noun phrases.

Provides methods for parsing determiners, adjectives, possessives, and converting noun phrases to first-order terms.

Required Methods§

Source

fn parse_noun_phrase( &mut self, greedy: bool, ) -> Result<NounPhrase<'a>, ParseError>

Parses a full noun phrase with optional greedy PP attachment.

Source

fn parse_noun_phrase_for_relative( &mut self, ) -> Result<NounPhrase<'a>, ParseError>

Parses a noun phrase suitable for relative clause antecedent.

Source

fn noun_phrase_to_term(&self, np: &NounPhrase<'a>) -> Term<'a>

Converts a parsed noun phrase to a first-order term.

Source

fn check_possessive(&self) -> bool

Checks for possessive marker (’s).

Source

fn check_of_preposition(&self) -> bool

Checks for “of” preposition (possessive or partitive).

Source

fn check_proper_name_or_label(&self) -> bool

Checks for proper name or label (capitalized).

Source

fn check_possessive_pronoun(&self) -> bool

Checks for possessive pronoun (his, her, its, their).

Implementors§

Source§

impl<'a, 'ctx, 'int> NounParsing<'a, 'ctx, 'int> for Parser<'a, 'ctx, 'int>