Whole file

miso-belica/sumy

The author described this change as Fixed wrong ordering of significant words in Luhn. It counts as a record because the check below fails on the code as it stood at f9107bd69 and passes on d0a55c45a, with nothing else changed between the two runs.

Fix saved2013-03-17
Sharing licenceApache-2.0 · LICENSE.md
Change size+1 1

What the code was meant to do, written into the code itself as a save note

Fixed wrong ordering of significant words in Luhn

The change

3030 if w not in self._stop_words)
3131
3232 # sort words by number of occurrences
33- words = sorted((c, w) for w, c in Counter(words).items())
33+ words = sorted(((c, w) for w, c in Counter(words).items()), reverse=True)
3434
3535 # take only best `significant_percentage` % words
3636 best_words_count = int(len(words) * self.significant_percentage)

The check that tells the two apart

failpass·tests/test_luhn.py::TestSentenceRating::test_significant_words

Check file tests/test_luhn.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itf9107bd69e6b05766dd76ee9f268c359cca9a280
Broken version dated2013-03-17
Modulesumy.algorithms.luhn
Units changedLuhnMethod
Fingerprint8ee40217e31a8f4f
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in miso-belica/sumy