Skip to content
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

add ability to manipulate stopwords #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

widnyana
Copy link
Contributor

merujuk pada issue #9, saya menambahkan 2 method untuk memanipulasi stopwords pada StopWordRemoverFactory

method pertama

menambahkan stopword baru ke default stopword

>>> text = 'Aku pernah mendengar Aisya bercerita bahwa sebenarnya ia tidak terlalu senang dengan kabar perjodohan yang diatur oleh orang tuanya.'

>>> factory = StopWordRemoverFactory()
>>> new_stopwords = ['dengan', 'ia', 'bahwa', 'oleh']
>>> factory.append_stop_words(new_stopwords)
>>> remover = factory.create_stop_word_remover()

>>> print(remover.remove(text))

method kedua

membuat instance factory langsung dengan me-load file.

>>> text = 'Aku pernah mendengar Aisya bercerita bahwa sebenarnya ia tidak terlalu senang dengan kabar perjodohan yang diatur oleh orang tuanya.'

>>> factory = StopWordRemoverFactory.from_file('/path/to/stopwords.csv', delimiter=",", replace=True)
>>> remover = factory.create_stop_word_remover()

>>> print(remover.remove(text))

please review :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.06%) to 96.317% when pulling 0e40516 on redite:feature/manipulate_stopwords into 0ab8ce2 on har07:master.

2 similar comments
@coveralls
Copy link

coveralls commented May 10, 2018

Coverage Status

Coverage decreased (-1.06%) to 96.317% when pulling 0e40516 on redite:feature/manipulate_stopwords into 0ab8ce2 on har07:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.06%) to 96.317% when pulling 0e40516 on redite:feature/manipulate_stopwords into 0ab8ce2 on har07:master.

@marantino
Copy link

Selamat malam mas, mau tanya bagaimana kalau mau mengurangi kata dari list stopwordnya? Terimakasih.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants