https://github.com/wooorm/stmr.c
Porter Stemmer algorithm in C
https://github.com/wooorm/stmr.c
porter stemmer stemming
Last synced: 6 months ago
JSON representation
Porter Stemmer algorithm in C
- Host: GitHub
- URL: https://github.com/wooorm/stmr.c
- Owner: wooorm
- License: mit
- Created: 2014-11-07T18:32:05.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2020-06-16T07:14:12.000Z (over 5 years ago)
- Last Synced: 2025-01-08T17:57:11.921Z (9 months ago)
- Topics: porter, stemmer, stemming
- Language: C
- Homepage:
- Size: 134 KB
- Stars: 39
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: funding.yml
- License: license
Awesome Lists containing this project
README
# stmr(3) [![Build Status][travis-badge]][travis] [![Coverage Status][coveralls-badge]][coveralls]
Martin Porter’s [Stemming algorithm][algo] as a C library.
There’s also a CLI: [stmr(1)][cli].## Installation
[clib][]:
```bash
clib install wooorm/stmr.c
```Or clone the repo.
## Usage
### `int stem(char *pointer, int start, int end)`
```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]
— CLI in C## License
[MIT][license] © [Titus Wormer][author]
[travis-badge]: https://img.shields.io/travis/wooorm/stmr.c.svg
[travis]: https://travis-ci.org/wooorm/stmr.c
[coveralls-badge]: https://img.shields.io/coveralls/wooorm/stmr.c.svg
[coveralls]: https://coveralls.io/github/wooorm/stmr.c
[license]: license
[author]: http://wooorm.com
[algo]: http://tartarus.org/martin/PorterStemmer/
[cli]: https://github.com/wooorm/stmr
[lib]: https://github.com/words/stemmer
[clib]: https://github.com/clibs/clib