Snowball Stemmer

The simple English stemmer provided in Relevanssi Premium is simple and does not work very well – it’s just a simple suffix stripper, and not a proper stemmer.

If you want a proper stemmer, you can install the Relevanssi Premium Snowball Stemmer add-on plugin. This plugin implements a proper stemmer for over dozen languages. The stemmer used is the Wamania native PHP stemmer, this plugin just makes it easy to use with Relevanssi Premium.

Current language support

Catalan · Danish · Dutch · English · Finnish · French · German · Italian · Norwegian · Portuguese · Romanian · Russian · Spanish · Swedish

Installing the plugin

The best way to install this plugin is as a Composer package from GitHub. That way you can get access to updates, in case the Wamania PHP stemmer is updated.

The plugin GitHub page is here, with instructions on how to add the plugin as a Composer dependency. (Make sure the plugin dependencies are also installed; that may not happen automatically.)

If you can’t use Composer, you can download the plugin here. This version does not include any automatic update functionality, but on the other hand, it probably doesn’t require much updating in the first place.

Requirements

Using this plugin properly requires Relevanssi Premium 2.10.3.

It’s possible to use the plugin with older versions of Relevanssi Premium, but in that case you can’t access the settings page and need to change the language by adjusting the options manually. English is the default language, so if you’re happy with that, you’ll be fine.

Changelog

  • 1.4 – adds a filter hook relevanssi_stemmer_allow_stemming (see below), updates the PHP stemmer
  • 1.3 – adds support for hooks introduced in Relevanssi Premium 2.15.1
  • 1.2 – updates the PHP stemmer
  • 1.1 – adds Finnish
  • 1.0 – initial release

Filter hooks

relevanssi_stemmer_allow_stemming – bool $allow, string $word, string $language
Controls whether a word can be stemmed or not. If the filter returns false, the word is returned unstemmed.