Registry / ai-ml / sastrawi

sastrawi

JSON →
library1.0.1pypypi✓ verified 84d ago

Sastrawi is a Python library for stemming Indonesian text (Bahasa). It provides algorithms to reduce inflected words to their base form. Current version is 1.0.1, released in 2019. The project is in maintenance mode with infrequent updates.

pip install sastrawi
INSTALL
IMPORT
SIG · SASTRAWI
S
sastrawi
ai-mlpythonv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StemmerFactory
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory
from sastrawi import StemmerFactory
Sastrawi uses capital 'S' in module path; incorrect casing leads to ModuleNotFoundError.

Basic usage: create a stemmer instance and stem a sentence.

from Sastrawi.Stemmer.StemmerFactory import StemmerFactory factory = StemmerFactory() stemmer = factory.create_stemmer() sentence = 'Mereka sedang belajar di perpustakaan' result = stemmer.stem(sentence) print(result) # Output: mereka sedang ajar di pustaka
Debug
Known issues
deprecatedSastrawi 1.0.1 is the last release; no active development since 2019. Consider using alternatives for new projects.
fix
Evaluate other Indonesian NLP libraries such as IndoBERT or PySastrawi (if maintained).
affects: >=1.0.0
gotchaImport path is case-sensitive: use 'Sastrawi' with capital S, not 'sastrawi'.
fix
Use 'from Sastrawi.Stemmer.StemmerFactory import StemmerFactory'.
affects: all
gotchaStemmerFactory must be instantiated; do not import the factory class and try to call create_stemmer on it directly without instantiation.
fix
StemmerFactory() then .create_stemmer().
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'Sastrawi'
Trying to import with lowercase 'sastrawi' or forgetting to install the package.
fix
Install with 'pip install sastrawi' and import with 'from Sastrawi...' (capital S).
AttributeError: module 'Sastrawi' has no attribute 'Stemmer'
Importing from the top-level package instead of the full path.
fix
Use 'from Sastrawi.Stemmer.StemmerFactory import StemmerFactory'.
TypeError: 'module' object is not callable
Calling 'StemmerFactory' directly without instantiating it.
fix
Create an instance: 'factory = StemmerFactory()' then 'stemmer = factory.create_stemmer()'.
Upgrade
Version history
1.0.1latest on PyPI · released Jan 18, 2016
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
1
Resources
sastrawi — pip install sastrawi · libregistry