summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-07-04 14:50:51 +0000
committerTed Trask <ttrask01@yahoo.com>2014-07-04 14:50:51 +0000
commit68f37a3b6addeb96cf462fd58df16718b1209a6e (patch)
tree1bc323d4430b1daf0fff8a850c5860edcabb4f1e
parent2085d5d5624261bafd6039d7ef38cf5cef38128b (diff)
downloadacf-weblog-68f37a3b6addeb96cf462fd58df16718b1209a6e.tar.bz2
acf-weblog-68f37a3b6addeb96cf462fd58df16718b1209a6e.tar.xz
Bug fix to ignore blank lines in word lists
-rw-r--r--weblog-model.lua49
1 files changed, 30 insertions, 19 deletions
diff --git a/weblog-model.lua b/weblog-model.lua
index 3b3cc40..d3f5271 100644
--- a/weblog-model.lua
+++ b/weblog-model.lua
@@ -465,11 +465,15 @@ local function checkwords(logentry)
if not thisline then
break
end
- _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
- if instcnt ~= 0 then
- logentry.ignoreme = true
- --logme("ignoring...")
- break
+
+ -- ignore blank lines
+ if string.find(thisline, "%S") then
+ _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
+ if instcnt ~= 0 then
+ logentry.ignoreme = true
+ --logme("ignoring...")
+ break
+ end
end
end
@@ -480,12 +484,15 @@ local function checkwords(logentry)
break
end
- _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
- if instcnt ~= 0 then
- -- logme("instcnt = "..instcnt)
- isbad=1
- wrdcnt= wrdcnt + instcnt
- badwordloc[#badwordloc+1] = thisline
+ -- ignore blank lines
+ if string.find(thisline, "%S") then
+ _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(thisline), " ")
+ if instcnt ~= 0 then
+ -- logme("instcnt = "..instcnt)
+ isbad=1
+ wrdcnt= wrdcnt + instcnt
+ badwordloc[#badwordloc+1] = thisline
+ end
end
end
@@ -523,15 +530,19 @@ local function checkwords(logentry)
if not goodline then
break
end
- _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(goodline), " ")
- --if string.find(logentry.URL,goodline) then
- if instcnt ~= 0 then
- if wrdcnt >= instcnt then
- wrdcnt = wrdcnt - instcnt
- else
- wrdcnt = 0
+
+ -- ignore blank lines
+ if string.find(thisline, "%S") then
+ _,instcnt = string.lower(logentry.URL):gsub(format.escapemagiccharacters(goodline), " ")
+ --if string.find(logentry.URL,goodline) then
+ if instcnt ~= 0 then
+ if wrdcnt >= instcnt then
+ wrdcnt = wrdcnt - instcnt
+ else
+ wrdcnt = 0
+ end
+ goodwordloc[#goodwordloc+1] = goodline
end
- goodwordloc[#goodwordloc+1] = goodline
end
end
end