pub struct NounPhrase<'a> {
pub definiteness: Option<Definiteness>,
pub adjectives: &'a [Symbol],
pub noun: Symbol,
pub possessor: Option<&'a NounPhrase<'a>>,
pub pps: &'a [&'a LogicExpr<'a>],
pub superlative: Option<Symbol>,
}Expand description
Parsed noun phrase structure for compositional interpretation.
Captures the internal structure of noun phrases including determiners, modifiers, and possessives for correct semantic composition.
Fields§
§definiteness: Option<Definiteness>Definiteness: the (definite), a/an (indefinite), or bare (none).
adjectives: &'a [Symbol]Pre-nominal adjectives (e.g., “big red” in “big red ball”).
noun: SymbolHead noun (e.g., “ball” in “big red ball”).
possessor: Option<&'a NounPhrase<'a>>Possessor phrase (e.g., “John’s” in “John’s book”).
pps: &'a [&'a LogicExpr<'a>]Prepositional phrase modifiers attached to noun.
superlative: Option<Symbol>Superlative adjective if present (e.g., “tallest”).
Implementations§
Source§impl<'a> NounPhrase<'a>
impl<'a> NounPhrase<'a>
pub fn simple(noun: Symbol) -> Self
pub fn with_definiteness(definiteness: Definiteness, noun: Symbol) -> Self
Source§impl<'a> NounPhrase<'a>
impl<'a> NounPhrase<'a>
Sourcepub fn to_symbol(
&self,
registry: &mut SymbolRegistry,
interner: &Interner,
) -> String
pub fn to_symbol( &self, registry: &mut SymbolRegistry, interner: &Interner, ) -> String
Converts the noun phrase to a short logic symbol (e.g., “C” for “cat”).
Sourcepub fn to_symbol_full(
&self,
registry: &SymbolRegistry,
interner: &Interner,
) -> String
pub fn to_symbol_full( &self, registry: &SymbolRegistry, interner: &Interner, ) -> String
Converts the noun phrase to a full logic symbol (e.g., “Cat” for “cat”).
Trait Implementations§
Source§impl<'a> Debug for NounPhrase<'a>
impl<'a> Debug for NounPhrase<'a>
Source§impl<'a> DisplayWith for NounPhrase<'a>
impl<'a> DisplayWith for NounPhrase<'a>
Source§impl<'a, 'b> Resolve<'a> for NounPhrase<'b>
impl<'a, 'b> Resolve<'a> for NounPhrase<'b>
type Output = NounPhraseView<'a>
fn resolve(&self, interner: &'a Interner) -> NounPhraseView<'a>
Auto Trait Implementations§
impl<'a> Freeze for NounPhrase<'a>
impl<'a> RefUnwindSafe for NounPhrase<'a>
impl<'a> Send for NounPhrase<'a>
impl<'a> Sync for NounPhrase<'a>
impl<'a> Unpin for NounPhrase<'a>
impl<'a> UnwindSafe for NounPhrase<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more