-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bring back original README; bump version
- Loading branch information
Showing
4 changed files
with
89 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ python: | |
- "3.4" | ||
- "3.5" | ||
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
sudo: false | ||
install: | ||
- pip install python-coveralls | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
PySastrawi | ||
=============== | ||
|
||
Sastrawi Python adalah library python sederhana untuk mengubah kata-kata berimbuhan dalam Bahasa Indonsia kembali ke bentuk kata dasarnya, atau yang dikenal dengan istilah [*stemming*](http://en.wikipedia.org/wiki/Stemming). | ||
Repository ini adalah hasil *porting* dari [Sastrawi](https://github.com/sastrawi/sastrawi), library dengan fungsi yang sama untuk bahasa pemrograman PHP. | ||
Di PySastrawi versi 2.0 source code PySastrawi mengalami refactoring agar menjadi lebih simpel dan mengikuti style coding python standar, credits to [@kekavigi](https://github.com/kekavigi) dan kontributor lainnya (lihat daftar kontributor selengkapnya [di sini](https://github.com/har07/PySastrawi/graphs/contributors)). | ||
|
||
[![Build Status](https://travis-ci.org/har07/PySastrawi.svg?branch=master)](https://travis-ci.org/har07/PySastrawi) | ||
[![Coverage Status](https://coveralls.io/repos/github/har07/PySastrawi/badge.svg?branch=master)](https://coveralls.io/github/har07/PySastrawi?branch=master) | ||
[![PyPI version](https://badge.fury.io/py/PySastrawi.svg)](https://badge.fury.io/py/PySastrawi) | ||
|
||
Cara Install | ||
------------- | ||
|
||
Sastrawi dapat di-*install* menggunakan [pip](https://docs.python.org/3.6/installing/index.html), dengan menjalankan perintah berikut di terminal/command prompt : `pip install PySastrawi` | ||
|
||
Penggunaan | ||
----------- | ||
|
||
Jalankan baris-baris kode berikut di *Python interactive terminal* : | ||
|
||
```python | ||
import sastrawi | ||
|
||
stemmer = sastrawi.Stemmer() | ||
|
||
# stemming process | ||
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 (version 1.2.0) | ||
-------- | ||
|
||
Live demo URL : https://pysastrawi-demo.appspot.com/ | ||
|
||
Repository : https://github.com/har07/pystastrawi-demo | ||
|
||
Lisensi | ||
-------- | ||
|
||
Lisensi Sastrawi Python adalah MIT License (MIT). | ||
|
||
Project ini mengandung kamus kata dasar yang berasal dari Kateglo dengan lisensi [CC-BY-NC-SA 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/). | ||
|
||
Informasi Lebih Lanjut | ||
---------------------- | ||
|
||
- [Sastrawi PHP Repository page](https://github.com/sastrawi/sastrawi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,56 @@ | ||
# Stemmer | ||
Sastrawi Python | ||
=============== | ||
|
||
Ini adalah kode Python sederhana yang memungkinkan anda untuk mengubah kata berimbuhan dalam Bahasa Indonesia ke bentuk kata dasar ([stem](http://en.wikipedia.org/wiki/Stemming)). Proyek ini adalah perbaikan dari proyek [PySastrawi]https://github.com/har07/PySastrawi). | ||
Sastrawi Python is a simple python library which allows you to reduce inflected words in Indonesian Language (Bahasa Indonesia) to their base form ([stem](http://en.wikipedia.org/wiki/Stemming)). This is Python port of the original [Sastrawi](https://github.com/sastrawi/sastrawi) project written in PHP (credits goes to the original author and contributors of Sastrawi PHP). | ||
|
||
Penggunaan | ||
Version 2.0 contains heavy refactoring of the codebase to be simpler and more pythonic, credits to [@kekavigi](https://github.com/kekavigi) and other contributors. | ||
|
||
|
||
[![Build Status](https://travis-ci.org/har07/PySastrawi.svg?branch=master)](https://travis-ci.org/har07/PySastrawi) | ||
[![Coverage Status](https://coveralls.io/repos/github/har07/PySastrawi/badge.svg?branch=master)](https://coveralls.io/github/har07/PySastrawi?branch=master) | ||
[![PyPI version](https://badge.fury.io/py/PySastrawi.svg)](https://badge.fury.io/py/PySastrawi) | ||
|
||
Read this in [Bahasa Indonesia](README.id.md) | ||
|
||
Installation | ||
------------- | ||
|
||
Install Sastrawi using [pip](https://docs.python.org/3.6/installing/index.html): `pip install PySastrawi` | ||
|
||
Example usage | ||
----------- | ||
|
||
```python | ||
import sastrawi | ||
|
||
stemmer = sastrawi.Stemmer() | ||
|
||
sentences = ['Perekonomian Indonesia sedang dalam pertumbuhan yang membanggakan', | ||
'Mereka meniru-nirukannya'] | ||
# stemming process | ||
sentence = 'Perekonomian Indonesia sedang dalam pertumbuhan yang membanggakan' | ||
output = stemmer.stem(sentence) | ||
|
||
# proses stemming | ||
for sentence in sentences: | ||
print(stemmer.stem(sentence)) | ||
print(output) | ||
# ekonomi indonesia sedang dalam tumbuh yang bangga | ||
# mereka tiru | ||
|
||
# hilangkan stopwords | ||
for sentence in sentences: | ||
print(stemmer.stem(sentence)) | ||
# perekonomian indonesia pertumbuhan membanggakan | ||
# meniru-nirukannya | ||
|
||
# lebih dalam tentang proses stemming | ||
res = stemmer.context('meniru-nirukannya')) | ||
# ['tiru', [('me', 'DP'), ('nya', 'PP'), ('kan', 'DS')]] | ||
|
||
print(stemmer.stem('Mereka meniru-nirukannya')) | ||
# mereka tiru | ||
``` | ||
|
||
Demo | ||
Demo (version 1.2.0) | ||
-------- | ||
|
||
Live demo URL : https://pysastrawi-demo.appspot.com/ | ||
|
||
Repository : https://github.com/har07/pystastrawi-demo | ||
|
||
Lisensi | ||
License | ||
-------- | ||
|
||
Lisensi PySastrawi adalah MIT License (MIT). | ||
Sastrawi Python registered under MIT License (MIT). | ||
|
||
Project ini mengandung kamus kata dasar yang berasal dari Kateglo dengan lisensi | ||
[CC-BY-NC-SA 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/). | ||
This project contains dictionary of Indonesian words from Kateglo with [CC-BY-NC-SA 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/) license. | ||
|
||
Informasi Lebih Lanjut | ||
More Information | ||
---------------------- | ||
|
||
- [Halaman Repository Sastrawi PHP](https://github.com/sastrawi/sastrawi) | ||
- [Sastrawi PHP Repository page](https://github.com/sastrawi/sastrawi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters