Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info about the Spanish Plural Stemmer #3040

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3223,14 +3223,15 @@ With class name (legacy)::

=== Spanish

Solr includes two stemmers for Spanish: one in the `solr.SnowballPorterFilterFactory language="Spanish"`, and a lighter stemmer called `solr.SpanishLightStemFilterFactory`.
Solr includes three stemmers for Spanish: the `solr.SnowballPorterFilterFactory language="Spanish"`, a lighter stemmer called `solr.SpanishLightStemFilterFactory` and a plural stemmer called `solr.SpanishPluralStemFilter` (https://mices.co/mices2021/slides/Xavier-Sanchez_Spanish-Stemmers-Solr.pdf[slides], https://medium.com/inside-wallapop/spanish-plural-stemmer-matching-plural-and-singular-forms-in-spanish-using-lucene-93e005e38373[article]) that implements the rules described in http://www.wikilengua.org/index.php/Plural_(formación) and can be useful in conjunction with synonyms as it produces meaningful tokens in the singular form (e.g. `amigo`, not `amig`).

Lucene includes an example stopword list.

*Factory class:* `solr.SpanishStemFilterFactory`

*Arguments:* None

*Example:*
*Example 1:*

[tabs#lang-spanish]
======
Expand Down Expand Up @@ -3267,6 +3268,42 @@ With class name (legacy)::

*Out:* "tor", "tor", "tor"

*Example 2:*

[tabs#lang-spanish]
======
With name::
+
====
[source,xml]
----
<analyzer>
<tokenizer name="standard"/>
<filter name="lowercase"/>
<filter name="spanishPluralStem"/>
</analyzer>
----
====

With class name (legacy)::
+
====
[source,xml]
----
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SpanishPluralStemFilterFactory"/>
</analyzer>
----
====
======

*In:* "ases esprais paces bits amigos cantar caries"

*Tokenizer to Filter:* "ases", "esprais", "paces", "bits", "amigos", "cantar", "caries"

*Out:* "as", "espray", "paz", "bit", "amigo", "cantar", "caries"

=== Swedish

Expand Down
Loading