skip to navigation
skip to content

Sastrawi 1.0.1

Library for stemming Indonesian (Bahasa) text

Sastrawi is a simple Python library which allows you to reduce inflected words in Indonesian Language (Bahasa Indonesia) to their base form (stem).
This is Python port of the original Sastrawi project written in PHP.


Sastrawi can be installed via pip, by running the following commands in terminal/command prompt : pip install Sastrawi

Example Usage

Run the following commands in Python interactive terminal :

# import Sastrawi package
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory

# create stemmer
factory = StemmerFactory()
stemmer = factory.create_stemmer()

# stem
sentence = 'Perekonomian Indonesia sedang dalam pertumbuhan yang membanggakan'
output   = stemmer.stem(sentence)

# ekonomi indonesia sedang dalam tumbuh yang bangga

print(stemmer.stem('Mereka meniru-nirukannya'))
# mereka tiru
File Type Py Version Uploaded on Size
Sastrawi-1.0.1-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2016-01-18 204KB (md5) Source 2016-01-18 206KB