Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 1.7 KB

README.rst

File metadata and controls

63 lines (44 loc) · 1.7 KB

Sastrawi

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.

Build Status Coverage Status

Installation

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)

print(output)
# ekonomi indonesia sedang dalam tumbuh yang bangga

print(stemmer.stem('Mereka meniru-nirukannya'))
# mereka tiru

Demo

Live demo : https://pysastrawi-demo.appspot.com/

Repository : https://github.com/har07/pystastrawi-demo

More Info