Porter Stemmer algorithm in C; Titus (2014).
npm install stmr.cbash
$ npm i stmr.c
`
And then include stmr.h as follows:
`c
#include "node_modules/stmr.c/stmr.h"
`
You may also want to include stmr.c as follows:
`c
#ifndef __STMR_C__
#define __STMR_C__
#include "node_modules/stmr.c/stmr.c"
#endif
`
This will include both the function declaration and their definitions into a single file.
Or use
[clib][]:
`bash
clib install wooorm/stmr.c
`
Or clone the repo.
Usage
$3
`c
#include
#include
#include "stmr.h"
int
main(int argc, char **argv) {
char *word = argv[1];
int end = stem(word, 0, strlen(word) - 1);
word[end + 1] = 0;
printf("%s", word);
}
`
Related
* [stemmer][lib] — Same algorithm in JavaScript
* [stmr`][cli]