Skip to content

Commit 122ec4f

Browse files
committed
Show ALL pattern-matching product names in "why"
1 parent 0a57cd2 commit 122ec4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

findspam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,9 @@ def pattern_product_name(s, site, *args):
355355
three_words = regex.compile(r"(?i)\b(({0})[ -]({0})[ -]({0}))\b".format(keywords)).findall(s)
356356
two_words = regex.compile(r"(?i)\b(({0})[ -]({0}))\b".format(keywords)).findall(s)
357357
if len(three_words) >= 1 and all_matches_unique(three_words):
358-
return True, u"Pattern-matching product name *{}*".format(three_words[0][0])
358+
return True, u"Pattern-matching product name *{}*".format(", ".join(match[0] for match in three_words))
359359
if len(two_words) >= 2 and all_matches_unique(two_words):
360-
return True, u"Pattern-matching product name *{}*".format(two_words[0][0])
360+
return True, u"Pattern-matching product name *{}*".format(", ".join(match[0] for match in two_words))
361361
return False, ""
362362

363363

0 commit comments

Comments
 (0)