This is a port of stemmer for Czech language to Javascript, for both node.js and browser.
JavaScript Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
original
README.md
agressive.js
light.js
package.json
stringbuffer.js

README.md

Czech stemmer

This is a port of stemmer for Czech language to Javascript, for both node.js and browser.

Original code is a Java program by Jacques Savoy released under BSD license.

To get stemmer for other languages, check out Snowball and its javascript port snowball-js.

Usage

Use it in node:

// using default agressive stemmer
var stem = require('czech-stemmer');
stem('nejneobhospodařovávatelnějšími'); // => 'nejneobhospodařováva'

// using lighter version of stemmer
var stem_light = require('czech-stemmer/light.js');
stem_light('nejneobhospodařovávatelnějšími'); // => 'nejneobhospodařovávatelnějš'

Use it in browser:

<script src="../stringbuffer.js"></script>
<script src="../agressive.js"></script>
<script>
    czech_stem('nejneobhospodařovávatelnějšími');
</script>

Technical details

To reuse Java code as much as possible, limited version of StringBuffer was implemented as a shim and only few code replacements were performed:

  • class definition -> function constructor
  • 'private void' -> 'function'
  • 'int ' -> 'var '
  • 'StringBuffer ' -> ''