Skip to content

Commit

Permalink
Typo: bunus -> bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
miso-belica committed Nov 1, 2020
1 parent aac92c6 commit 29272fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sumy/summarizers/edmundson.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def _update_ratings(self, ratings, new_ratings):

return ratings

def cue_method(self, document, sentences_count, bunus_word_value=1, stigma_word_value=1):
def cue_method(self, document, sentences_count, bonus_word_value=1, stigma_word_value=1):
summarization_method = self._build_cue_method_instance()
return summarization_method(document, sentences_count, bunus_word_value,
return summarization_method(document, sentences_count, bonus_word_value,
stigma_word_value)

def _build_cue_method_instance(self):
Expand Down
12 changes: 6 additions & 6 deletions sumy/summarizers/edmundson_cue.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ def __init__(self, stemmer, bonus_words, stigma_words):
self._bonus_words = bonus_words
self._stigma_words = stigma_words

def __call__(self, document, sentences_count, bunus_word_weight, stigma_word_weight):
def __call__(self, document, sentences_count, bonus_word_weight, stigma_word_weight):
return self._get_best_sentences(document.sentences,
sentences_count, self._rate_sentence, bunus_word_weight,
sentences_count, self._rate_sentence, bonus_word_weight,
stigma_word_weight)

def _rate_sentence(self, sentence, bunus_word_weight, stigma_word_weight):
def _rate_sentence(self, sentence, bonus_word_weight, stigma_word_weight):
# count number of bonus/stigma words in sentece
words = map(self.stem_word, sentence.words)
bonus_words_count, stigma_words_count = self._count_words(words)

# compute positive & negative rating
bonus_rating = bonus_words_count*bunus_word_weight
bonus_rating = bonus_words_count*bonus_word_weight
stigma_rating = stigma_words_count*stigma_word_weight

# rating of sentence is (positive - negative) rating
Expand All @@ -49,6 +49,6 @@ def _count_words(self, words):

return bonus_words_count, stigma_words_count

def rate_sentences(self, document, bunus_word_weight=1, stigma_word_weight=1):
return {sentence: self._rate_sentence(sentence, bunus_word_weight,
def rate_sentences(self, document, bonus_word_weight=1, stigma_word_weight=1):
return {sentence: self._rate_sentence(sentence, bonus_word_weight,
stigma_word_weight) for sentence in document.sentences}

0 comments on commit 29272fe

Please sign in to comment.