Less chance of silly 1-comparison.
This commit is contained in:
parent
5e9138e55c
commit
6d3faf178a
7
main.lua
7
main.lua
|
@ -424,12 +424,15 @@ local function get_topics_from_comparison_message(message)
|
||||||
if comp then
|
if comp then
|
||||||
local topics = {}
|
local topics = {}
|
||||||
for topic in message:gmatch('[^'..comp..']+') do
|
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
|
end
|
||||||
-- Rev
|
-- Rev
|
||||||
if comp == '>' then topics = reverse(topics) end
|
if comp == '>' then topics = reverse(topics) end
|
||||||
--
|
--
|
||||||
return topics
|
return (#topics >= 2) and topics or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Natural language comparisons
|
-- Natural language comparisons
|
||||||
|
|
Loading…
Reference in New Issue
Block a user