Skip to content

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