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) -> NounPhrase<'a>
pub fn with_definiteness( definiteness: Definiteness, noun: Symbol, ) -> NounPhrase<'a>
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> Clone for NounPhrase<'a>
impl<'a> Clone for NounPhrase<'a>
Source§fn clone(&self) -> NounPhrase<'a>
fn clone(&self) -> NounPhrase<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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>
impl<'a> Copy for NounPhrase<'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> UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.