experimental malayalam stemmer
Python HTML Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
libindic/stemmer
.coveragerc
.gitignore
.testr.conf
.travis.yml
AUTHORS
ChangeLog
Makefile
README.md
circle.yml
requirements.txt
setup.cfg
setup.py
test-requirements.txt
tox.ini

README.md

LibIndic Stemmer

Build Status Coverage Status

LibIndic's stemmer module may be used to extract stems of the words in a sentence. It is implemented in a rule-based model and follows iterative suffix stripping to handle multiple levels of inflection. Right now, it supports Malayalam language only.

Installation

  1. Clone the repository git clone https://github.com/libindic/indicstemmer.git
  2. Change to the cloned directory cd indicstemmer
  3. Run setup.py to create installable source python setup.py sdist
  4. Install using pip pip install dist/stemmer*.tar.gz

Note: Prefer using virtualenv for installation as the library is in experimental stage

Usage

Input: String <str> containing words word1 word2 word3 ...
Output: Dict <dict> of the format
{
    'word1': {
                        'stem': 'stem1',
                        'inflection': ['tag1', 'tag2', ...]
             },
    'word2': {
                        'stem': 'stem2',
                        'inflection': ['tag1', 'tag2', ...]
             },
    .
    .
    .
}

>>> from libindic.stemmer import Malayalam as mlstemmer
>>> stemmer = mlstemmer()
>>> result = stemmer.stem('രാമന്റെ വീട്ടിലേക്ക്')
for word, output in result.items():
...    print word, " : ", output['stem'], " : ", output['inflection']
രാമന്റെ  :  രാമൻ  :  ['SAMB1']
വീട്ടിലേക്ക്  :  വീട്  :  ['MISC1', 'ADH1', 'UDH1']

For more details read the docs