-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memberikan Opsi Stopword Custom dan Menambahkan min_length #14
base: master
Are you sure you want to change the base?
Conversation
…urang dari min_length akan di hapus juga
# reformat code sehingga lebih rapi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perlu dipertimbangkan kembali penambahan type hints karena akan menyebabkan pysastrawi tidak lagi support python 2
class StopWordRemoverFactory(object): | ||
"""description of class""" | ||
|
||
def create_stop_word_remover(self, words = None): | ||
def create_stop_word_remover(self, words: list = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keliatannya fitur type hints tidak dikenali di python 2.7 sehingga menyebabkan build error: https://travis-ci.org/har07/PySastrawi/builds/430521968?utm_source=github_status&utm_medium=notification
@@ -7,10 +7,10 @@ def __init__(self, dictionary): | |||
def get_dictionary(self): | |||
return self.dictionary | |||
|
|||
def remove(self, text): | |||
def remove(self, text, min_length: int = 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keliatannya fitur type hints tidak dikenali di python 2.7 sehingga menyebabkan build error: https://travis-ci.org/har07/PySastrawi/builds/430521968?utm_source=github_status&utm_medium=notification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bagaimana kalau dihapus saja bagian type hints nya (: int
)? Sayang sekali kalau harus drop support untuk python 2.7 karena version 2.7 masih banyak beredar (default di ubuntu < 18.04 dll), termasuk di laptop saya 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup gk masalah sih mas, berarti yg gk bisa di python 2.7 cuma :int nya kan?
class StopWordRemoverFactory(object): | ||
"""description of class""" | ||
|
||
def create_stop_word_remover(self): | ||
stopWords = self.get_stop_words() | ||
def create_stop_word_remover(self, words: list = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another type hints detected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mohon dihilangkan dahulu penggunaan type hints nya. Terima kasih
Penambahan contoh cara penggunaan 2 parameter baru di atas ke dalam README juga akan sangat membantu |
Selamat malam, mau tanya bagaimana jika mau mengurangi kata yang termasuk kedalam stopwordnya? Terimakasih. |
Menurut saya stopword custom sangat memungkinkan dalam pemrosesan text, jadi diperlukan untuk penambahan opsi jika user yang menggunakan library ini dapat menggunakan file stopword sendiri
Kemudian, menurut saya opsi min_length juga bisa ditambahkan pada stopword, sehingga jika user memberikan min_length maka string dengan jumlah character kurang akan dihapus juga
*kedua usul ini merupakan opsi yang hanya akan terjadi jika user menambahkan parameter, jadi secara default tetap seperti sebelumnya