Skip to main content

FtsTokenizerBuilder

Struct FtsTokenizerBuilder 

Source
pub struct FtsTokenizerBuilder { /* private fields */ }
Expand description

Builder for FtsTokenizer.

Implementations§

Source§

impl FtsTokenizerBuilder

Source

pub fn stopwords(self, s: StopwordSet) -> Self

Use a custom stopword set instead of the built-in list.

Source

pub fn synonyms(self, m: SynonymMap) -> Self

Attach a synonym map for expansion.

Source

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.

Source

pub fn pos_tagger(self, t: PosTagger) -> Self

Use a custom POS tagger instead of the built-in table.

Source

pub fn ne_tagger(self, t: NeTagger) -> Self

Use a custom NE gazetteer instead of the built-in table.

Source

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.

Source

pub fn build(self) -> FtsTokenizer

Consume the builder and return a configured FtsTokenizer.

Trait Implementations§

Source§

impl Default for FtsTokenizerBuilder

Source§

fn default() -> FtsTokenizerBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.