pub struct FtsTokenizerBuilder { /* private fields */ }Expand description
Builder for FtsTokenizer.
Implementations§
Source§impl FtsTokenizerBuilder
impl FtsTokenizerBuilder
Sourcepub fn stopwords(self, s: StopwordSet) -> Self
pub fn stopwords(self, s: StopwordSet) -> Self
Use a custom stopword set instead of the built-in list.
Sourcepub fn synonyms(self, m: SynonymMap) -> Self
pub fn synonyms(self, m: SynonymMap) -> Self
Attach a synonym map for expansion.
Sourcepub fn ngram_size(self, n: usize) -> Self
pub fn ngram_size(self, n: usize) -> Self
Override the n-gram size used for TokenKind::Unknown tokens.
Default: 3 (trigrams). Set to 0 to disable n-gram generation.
Sourcepub fn pos_tagger(self, t: PosTagger) -> Self
pub fn pos_tagger(self, t: PosTagger) -> Self
Use a custom POS tagger instead of the built-in table.
Sourcepub fn ne_tagger(self, t: NeTagger) -> Self
pub fn ne_tagger(self, t: NeTagger) -> Self
Use a custom NE gazetteer instead of the built-in table.
Sourcepub fn romanization(self, m: RomanizationMap) -> Self
pub fn romanization(self, m: RomanizationMap) -> Self
Attach a romanization map so RTGS forms are added to FtsToken::synonyms.
When set, each Thai and Named token whose text is found in the map gets its
RTGS romanization appended to synonyms, enabling Latin-script queries
(e.g. kin) to match Thai-script documents (e.g. กิน) in PostgreSQL FTS.
Disabled by default — call this method to opt in.
Sourcepub fn build(self) -> FtsTokenizer
pub fn build(self) -> FtsTokenizer
Consume the builder and return a configured FtsTokenizer.
Trait Implementations§
Source§impl Default for FtsTokenizerBuilder
impl Default for FtsTokenizerBuilder
Source§fn default() -> FtsTokenizerBuilder
fn default() -> FtsTokenizerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FtsTokenizerBuilder
impl RefUnwindSafe for FtsTokenizerBuilder
impl Send for FtsTokenizerBuilder
impl Sync for FtsTokenizerBuilder
impl Unpin for FtsTokenizerBuilder
impl UnsafeUnpin for FtsTokenizerBuilder
impl UnwindSafe for FtsTokenizerBuilder
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