Skip to content

Commit

Permalink
bring back original README; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
har07 committed Apr 5, 2020
1 parent 4ecf2cd commit 16de908
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
sudo: false
install:
- pip install python-coveralls
Expand Down
55 changes: 55 additions & 0 deletions README.id.md
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)
57 changes: 31 additions & 26 deletions README.md
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)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.2.0',
version='2.0.0',

description='Library for stemming Indonesian (Bahasa) text',
long_description='Library for stemming Indonesian (Bahasa) text',
Expand Down

0 comments on commit 16de908

Please sign in to comment.