Less chance of silly 1-comparison.

This commit is contained in:
Jon Michael Aanes 2018-06-08 19:12:13 +02:00
parent 5e9138e55c
commit 6d3faf178a

View File

@ -424,12 +424,15 @@ local function get_topics_from_comparison_message(message)
if comp then
local topics = {}
for topic in message:gmatch('[^'..comp..']+') do
topics[#topics+1] = clean_text(topic)
local topic_text = clean_text(topic)
if topic_text:match '[^%s]' then
topics[#topics+1] = topic_text
end
end
-- Rev
if comp == '>' then topics = reverse(topics) end
--
return topics
return (#topics >= 2) and topics or nil
end
-- Natural language comparisons