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
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)
print(output)
# ekonomi indonesia sedang dalam tumbuh yang bangga
print(stemmer.stem('Mereka meniru-nirukannya'))
# mereka tiru
Live demo : https://pysastrawi-demo.appspot.com/
Repository : https://github.com/har07/pystastrawi-demo