-- Trie is rspamd module designed to define and operate with suffix trie
local tries = {}
+local rspamd_logger = require "rspamd_logger"
+local rspamd_trie = require "rspamd_trie"
local function split(str, delim, maxNb)
-- Eliminate bad cases...
file = io.open(params[2])
if file then
local trie = {}
- trie['trie'] = rspamd_trie:create(true)
+ trie['trie'] = rspamd_trie.create(true)
num = 0
for line in file:lines() do
trie['trie']:add_pattern(line, num)
else
local patterns = split(params[2], ',')
local trie = {}
- trie['trie'] = rspamd_trie:create(true)
+ trie['trie'] = rspamd_trie.create(true)
for num,pattern in ipairs(patterns) do
trie['trie']:add_pattern(pattern, num)
end