pub struct SyntaxAnalyzer { /* private fields */ }Expand description
Rule-based syntax analyzer
Implementations§
Source§impl SyntaxAnalyzer
impl SyntaxAnalyzer
Sourcepub fn new(config: SyntaxAnalyzerConfig) -> Self
pub fn new(config: SyntaxAnalyzerConfig) -> Self
Create a new syntax analyzer
Sourcepub fn parse_dependencies(&self, tokens: &[Token]) -> Result<Vec<Dependency>>
pub fn parse_dependencies(&self, tokens: &[Token]) -> Result<Vec<Dependency>>
Parse dependencies (simplified)
Sourcepub fn extract_noun_phrases(&self, tokens: &[Token]) -> Result<Vec<NounPhrase>>
pub fn extract_noun_phrases(&self, tokens: &[Token]) -> Result<Vec<NounPhrase>>
Extract noun phrases
Sourcepub fn segment_sentences(&self, text: &str) -> Vec<String>
pub fn segment_sentences(&self, text: &str) -> Vec<String>
Segment text into sentences
Auto Trait Implementations§
impl Freeze for SyntaxAnalyzer
impl RefUnwindSafe for SyntaxAnalyzer
impl Send for SyntaxAnalyzer
impl Sync for SyntaxAnalyzer
impl Unpin for SyntaxAnalyzer
impl UnsafeUnpin for SyntaxAnalyzer
impl UnwindSafe for SyntaxAnalyzer
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> 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