cadrumo.core.spanish_stemming module

Canonical Spanish lexical tokenisation and Snowball stemming primitives.

The command-discovery and corpus-grounding indexes share the same two lexical operations: Unicode word extraction after case normalisation, and Spanish Snowball stemming. Keeping those primitives here makes both indexes build and query the same lexical vocabulary while leaving each index responsible for its own FTS layout and ranking policy.

SpanishStemmer

The narrow Snowball contract the application’s lexical indexes consume.

alias of Callable[[list[str]], list[str]]

spanish_stemmer()[source]

Build the Spanish Snowball stemmer used by every shipped lexical index.

Return type:

Callable[[list[str]], list[str]]

spanish_word_tokens(text)[source]

Return lowercase Unicode word tokens from text in source order.

Return type:

tuple[str, ...]

Parameters:

text (str)

stem_spanish_terms(stemmer, terms)[source]

Stem a sequence of Spanish lexical terms without changing their order.

Return type:

tuple[str, ...]

Parameters:
stem_spanish_text(stemmer, text)[source]

Return the space-separated Spanish stems for the words in text.

Return type:

str

Parameters: