Registry / data / snowball-stemmers

snowball-stemmers

JSON →
library0.6.0jsnpmunverified

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-stemmers
INSTALL
IMPORT
SIG · SNOWBALL-STEMMERS
S
snowball-stemmers
datajavascriptv0.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

newStemmer (via default export)
const snowballFactory = require('snowball-stemmers'); const stemmer = snowballFactory.newStemmer('english');
import { newStemmer } from 'snowball-stemmers'; // wrong: not a named export
The package does not ship ES module types; it exports a factory function as default. Use CommonJS require. No type definitions provided.
algorithms
const snowballFactory = require('snowball-stemmers'); const algs = snowballFactory.algorithms();
const algorithms = require('snowball-stemmers/algorithms'); // wrong: no submodule path
algorithms is a method on the default export, listing all supported language names.
Stemmer instance (prototype methods)
const stemmer = snowballFactory.newStemmer('russian'); const result = stemmer.stem('чаво');
const result = snowballFactory.stem('чаво', 'russian'); // wrong: no such static method
Each stemmer instance has a stem() method. The factory creates instances per language.

Shows how to require the factory, create a stemmer for English, stem a word, and list all available algorithms.

const snowballFactory = require('snowball-stemmers'); const stemmer = snowballFactory.newStemmer('english'); console.log(stemmer.stem('running')); // 'run' console.log(snowballFactory.algorithms()); // ['arabic', 'armenian', ..., 'turkish']
Debug
Known issues
gotchaThe stem method may not handle non-ASCII characters correctly in all languages (e.g., Unicode normalization).
fix
Normalize input strings (NFKC) before stemming.
affects: <=0.6.0
gotchaThe package uses CommonJS and cannot be imported with ES module import syntax directly.
fix
Use require() instead of import. If using ESM, create a dynamic import wrapper.
affects: >=0.4
deprecatedSome algorithms like 'porter' are legacy and may be superseded by more recent Snowball algorithms.
fix
Use language-specific algorithm (e.g., 'english') instead of 'porter'.
affects: >=0.4
gotchaThe package is unmaintained since 2018; no updates for new languages or bug fixes.
fix
Consider using 'snowball-stemmer' (fork) or 'natural' library for active maintenance.
affects: *
Errors
Common errors & fixes
TypeError: require(...).newStemmer is not a function
Incorrect import style using named import or requiring wrong path.
fix
Use `const snowballFactory = require('snowball-stemmers');` then `snowballFactory.newStemmer('english')`.
Error: algorithm 'russin' not supported
Misspelling the language name.
fix
Check available algorithms with `snowballFactory.algorithms()`. Use exact string like 'russian'.
TypeError: stemmer.stem is not a function
Accessing stem method on the factory instead of an instance.
fix
Create a stemmer instance first: `const stemmer = snowballFactory.newStemmer('english');` then call `stemmer.stem(word)`.
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
snowball-stemmers — npm install snowball-stemmers · libregistry