sponsor Vim development Vim logo Vim Book Ad

porter-stem : PorterStem implements the Porter stemming algorithm for use as script utility

 script karma  Rating 1/1, Downloaded by 359  Comments, bugs, improvements  Vim wiki

created by
Mitchell Bowden
 
script type
utility
 
description
Source and associated data files for testing hosted at:
http://github.com/msbmsb/porter-stem.vim

PorterStem is a vim script that implements the Porter stemming algorithm, by Martin Porter, details of which can be found at: http://tartarus.org/~martin/PorterStemmer/

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 http://github.com/msbmsb/stem-search.vim for a script that uses this method for reverse-stem searching in a file.

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

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
porter-stem.vim 0.1 2010-09-04 6.0 Mitchell Bowden Initial upload
ip used for rating: 18.190.217.134

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github