JSPM

stmr.c

1.2020.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q9604F
  • License MIT

Porter Stemmer algorithm in C; Titus (2014).

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stmr.c) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    stmr(3) Build Status Coverage Status

    Martin Porter’s Stemming algorithm as a C library, by Titus. There’s also a CLI: stmr(1).

    Installation

    Run:

    $ npm i stmr.c

    And then include stmr.h as follows:

    #include "node_modules/stmr.c/stmr.h"

    You may also want to include stmr.c as follows:

    #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:

    clib install wooorm/stmr.c

    Or clone the repo.

    Usage

    int stem(char *pointer, int start, int end)

    #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);
    }
    • stemmer — Same algorithm in JavaScript
    • stmr — CLI in C

    License

    MIT © Titus Wormer



    ORG