Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



9 Commits

Repository files navigation

PorterStem is a vim script that implements the Porter stemming algorithm, by Martin Porter, details of which can be found at:

The main function outputs the single string of the stem, and the script only
echoes the output to the screen. This script, while it can be used as-is
if you want to know what the stem for a word is, is mostly a container for 
the algorithm implementation in vim script.

PorterStem command syntax:
-  :PorterStem (<word>)*

Each word input to the :PorterStem command will be stemmed and processed by
the ProcessStem function, that by default simply echoes to the screen.
Without any word given for input, it will attempt to stem the current word 
under the cursor via expand('<cword>').

For example:
-  :PorterStem searching
will output:
-  search
and a string of words will work as well, matching in order:
-  :PorterStem thieves are running from the bunny
will output:
-  thiev are run from bunni

Running :PorterTest <test-file> <expected-results-file> will run each 
word in <test-file> and match the stem result to the same line in the 
<expected-results-file>, showing if any are incorrect stem matches.
Provided in the github repository are two files voc.txt and output.txt 
from Martin Porter's site providing a set of test words.

To use this vim script, add it to ~/.vim/plugin/

See doc/porter-stem.vim.txt for more information about the script.
See for a script that uses this method for reverse-stem searching in a file.



Implementation of Porter stemming algorithm in vim script






No releases published


No packages published