Skip to content

evi1Husky/PorterStemmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Porter Stemmer

Martin Porter stemmer algorithm written in JavaScript. Reference: https://tartarus.org/martin/PorterStemmer/

Features

  • Follows original procedural implementation with char buffer and index pointers for the best performance.
  • Processes the 23k words test suit in 11ms on mobile i5 in node js.
  • It's just one big function that takes string and returns string, no side effects, classes or module scoped regexes.
  • Both ESM and CJS exports.

How to use

npm i porter-stemmer-js
import { PorterStemmer } from "porter-stemmer-js"

// the word to stem must be lower case with no trailing spaces or symbols

const stemmedWord = PorterStemmer("running");

console.log(stemmedWord) // "run"

License

This project is licensed under the MIT License.

About

Porter stemmer algorithm written in JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published