#[non_exhaustive]pub struct KgExtractConfig<'a> {
pub deny_tags: &'a [&'a str],
pub pos: WordNetPos,
}Expand description
Configuration for a single extraction pass.
Why: Bundles per-run configuration so extract_triples can be called with
different deny-lists (e.g. the default prod list vs. an empty list in
integration tests) without changing the function signature. #5399 added the
POS table here rather than to a process-wide OnceLock, which CLAUDE.md
forbids: the table is a 16-byte Copy handle over &'static str with no
build step, so passing it costs nothing and every caller can substitute a
different one.
What: Contains a deny_tags slice and a WordNetPos lookup. The
extractor skips any drawer whose tags intersect the deny set, and consults
the lookup when deciding which token in a noun phrase is its head.
#[non_exhaustive] so the next field is not another breaking change.
Test: extract_triples_skips_denied_tags, extract_triples_empty_deny_list,
a_caller_supplied_pos_table_is_the_one_consulted.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.Tags that cause extraction to be skipped entirely. Compared case-insensitively against the drawer’s tag list.
pos: WordNetPosPart-of-speech membership used to find the head of a noun phrase.
Trait Implementations§
Source§impl<'a> Clone for KgExtractConfig<'a>
impl<'a> Clone for KgExtractConfig<'a>
Source§impl<'a> Debug for KgExtractConfig<'a>
impl<'a> Debug for KgExtractConfig<'a>
Auto Trait Implementations§
impl<'a> Freeze for KgExtractConfig<'a>
impl<'a> RefUnwindSafe for KgExtractConfig<'a>
impl<'a> Send for KgExtractConfig<'a>
impl<'a> Sync for KgExtractConfig<'a>
impl<'a> Unpin for KgExtractConfig<'a>
impl<'a> UnsafeUnpin for KgExtractConfig<'a>
impl<'a> UnwindSafe for KgExtractConfig<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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