stmr(3)
Martin Porter’s Stemming algorithm1 as a C library. There’s also a CLI: stmr(1).
In fact, this is just a refactored version of the initial ANCI C implementation.
CLib:
$ clib install wooorm/stmr.c
Ore clone the repo.
#include <stdio.h>
#include <string.h>
#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);
}
MIT © Titus Wormer