pub struct ParsedQuery {
pub original: String,
pub entities: Vec<Entity>,
pub events: Vec<Event>,
pub modifiers: Vec<String>,
pub temporal: TemporalInfo,
pub is_attribute_query: bool,
pub attribute: Option<AttributeQuery>,
pub compounds: Vec<String>,
pub ic_weights: HashMap<String, f32>,
pub confidence: f32,
}Expand description
Result of parsing a query
Fields§
§original: StringOriginal query text
entities: Vec<Entity>Extracted entities (people, places, things)
events: Vec<Event>Extracted events/actions (verbs)
modifiers: Vec<String>Modifiers (adjectives, descriptors)
temporal: TemporalInfoTemporal information extracted from the query
is_attribute_query: boolWhether this is an attribute query (asking about a property)
attribute: Option<AttributeQuery>The attribute being asked about (if is_attribute_query)
compounds: Vec<String>Compound terms detected (e.g., “machine learning”)
ic_weights: HashMap<String, f32>IC weights for BM25 boosting
confidence: f32Confidence score (0.0 - 1.0)
Implementations§
Source§impl ParsedQuery
impl ParsedQuery
Sourcepub fn entity_texts(&self) -> Vec<&str>
pub fn entity_texts(&self) -> Vec<&str>
Get all entity texts
Sourcepub fn event_stems(&self) -> Vec<&str>
pub fn event_stems(&self) -> Vec<&str>
Get all event stems
Sourcepub fn is_temporal_query(&self) -> bool
pub fn is_temporal_query(&self) -> bool
Check if query is asking about time
Trait Implementations§
Source§impl Clone for ParsedQuery
impl Clone for ParsedQuery
Source§fn clone(&self) -> ParsedQuery
fn clone(&self) -> ParsedQuery
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParsedQuery
impl Debug for ParsedQuery
Source§impl<'de> Deserialize<'de> for ParsedQuery
impl<'de> Deserialize<'de> for ParsedQuery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ParsedQuery
impl RefUnwindSafe for ParsedQuery
impl Send for ParsedQuery
impl Sync for ParsedQuery
impl Unpin for ParsedQuery
impl UnsafeUnpin for ParsedQuery
impl UnwindSafe for ParsedQuery
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more