pub struct EntityExtractor { /* private fields */ }Expand description
Entity extraction engine using pattern matching
Implementations§
Source§impl EntityExtractor
impl EntityExtractor
pub fn new(config: EntityExtractionConfig) -> Self
Sourcepub fn extract(&self, text: &str) -> ExtractionResult
pub fn extract(&self, text: &str) -> ExtractionResult
Extract entities from text
Sourcepub fn add_custom_pattern(&mut self, pattern: &str, entity_type: EntityType)
pub fn add_custom_pattern(&mut self, pattern: &str, entity_type: EntityType)
Add a custom pattern for entity extraction
Sourcepub fn config(&self) -> &EntityExtractionConfig
pub fn config(&self) -> &EntityExtractionConfig
Get configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntityExtractor
impl RefUnwindSafe for EntityExtractor
impl Send for EntityExtractor
impl Sync for EntityExtractor
impl Unpin for EntityExtractor
impl UnsafeUnpin for EntityExtractor
impl UnwindSafe for EntityExtractor
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 moreCreates a shared type from an unshared type.