JavaScript port of the Snowball stemming algorithms (http://snowball.tartarus.org/), supporting 24 languages including Arabic, Russian, English, and more. The current stable version is 0.6.0, released sporadically. It is autogenerated from the Snowball compiler and uses ESJava. Key differentiators: lightweight, no dependencies, pure JS, and supports a wide range of languages. Compared to alternatives like natural or stemming libraries, it focuses on comprehensive language coverage. The library provides a simple factory API for creating stemmers and lists available algorithms.
npm install snowball-stemmersVerified import paths — ran on the pinned version, not inferred.
Shows how to require the factory, create a stemmer for English, stem a word, and list all available algorithms.
Normalize input strings (NFKC) before stemming.
Use require() instead of import. If using ESM, create a dynamic import wrapper.
Use language-specific algorithm (e.g., 'english') instead of 'porter'.
Consider using 'snowball-stemmer' (fork) or 'natural' library for active maintenance.
Use `const snowballFactory = require('snowball-stemmers');` then `snowballFactory.newStemmer('english')`.Check available algorithms with `snowballFactory.algorithms()`. Use exact string like 'russian'.
Create a stemmer instance first: `const stemmer = snowballFactory.newStemmer('english');` then call `stemmer.stem(word)`.No dependency data recorded yet.