{"id":18800,"library":"snowball-stemmers","title":"Snowball Stemmers","description":"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.","status":"active","version":"0.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/mazko/jssnowball","tags":["javascript","Snowball","Stemmer"],"install":[{"cmd":"npm install snowball-stemmers","lang":"bash","label":"npm"},{"cmd":"yarn add snowball-stemmers","lang":"bash","label":"yarn"},{"cmd":"pnpm add snowball-stemmers","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package does not ship ES module types; it exports a factory function as default. Use CommonJS require. No type definitions provided.","wrong":"import { newStemmer } from 'snowball-stemmers'; // wrong: not a named export","symbol":"newStemmer (via default export)","correct":"const snowballFactory = require('snowball-stemmers'); const stemmer = snowballFactory.newStemmer('english');"},{"note":"algorithms is a method on the default export, listing all supported language names.","wrong":"const algorithms = require('snowball-stemmers/algorithms'); // wrong: no submodule path","symbol":"algorithms","correct":"const snowballFactory = require('snowball-stemmers'); const algs = snowballFactory.algorithms();"},{"note":"Each stemmer instance has a stem() method. The factory creates instances per language.","wrong":"const result = snowballFactory.stem('чаво', 'russian'); // wrong: no such static method","symbol":"Stemmer instance (prototype methods)","correct":"const stemmer = snowballFactory.newStemmer('russian'); const result = stemmer.stem('чаво');"}],"quickstart":{"code":"const snowballFactory = require('snowball-stemmers');\n\nconst stemmer = snowballFactory.newStemmer('english');\nconsole.log(stemmer.stem('running')); // 'run'\n\nconsole.log(snowballFactory.algorithms());\n// ['arabic', 'armenian', ..., 'turkish']","lang":"javascript","description":"Shows how to require the factory, create a stemmer for English, stem a word, and list all available algorithms."},"warnings":[{"fix":"Normalize input strings (NFKC) before stemming.","message":"The stem method may not handle non-ASCII characters correctly in all languages (e.g., Unicode normalization).","severity":"gotcha","affected_versions":"<=0.6.0"},{"fix":"Use require() instead of import. If using ESM, create a dynamic import wrapper.","message":"The package uses CommonJS and cannot be imported with ES module import syntax directly.","severity":"gotcha","affected_versions":">=0.4"},{"fix":"Use language-specific algorithm (e.g., 'english') instead of 'porter'.","message":"Some algorithms like 'porter' are legacy and may be superseded by more recent Snowball algorithms.","severity":"deprecated","affected_versions":">=0.4"},{"fix":"Consider using 'snowball-stemmer' (fork) or 'natural' library for active maintenance.","message":"The package is unmaintained since 2018; no updates for new languages or bug fixes.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `const snowballFactory = require('snowball-stemmers');` then `snowballFactory.newStemmer('english')`.","cause":"Incorrect import style using named import or requiring wrong path.","error":"TypeError: require(...).newStemmer is not a function"},{"fix":"Check available algorithms with `snowballFactory.algorithms()`. Use exact string like 'russian'.","cause":"Misspelling the language name.","error":"Error: algorithm 'russin' not supported"},{"fix":"Create a stemmer instance first: `const stemmer = snowballFactory.newStemmer('english');` then call `stemmer.stem(word)`.","cause":"Accessing stem method on the factory instead of an instance.","error":"TypeError: stemmer.stem is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}