language_filter 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/language_filter.rb +4 -4
- data/lib/language_filter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e1c9631fe0b3dbfdf7b9fabedfb944e3e24f415
|
4
|
+
data.tar.gz: 9e2de907ce18dca2e42ce502e02a9e049c152abb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2f9f774e2bd8225f5777f2a9b69a8dada15b20db7dc488f878ece855cafa1a7d0dcdc78af3532fbbd929483d25887fa688821ef016a5827ef865d48ed2e60f2
|
7
|
+
data.tar.gz: af3809386cf240297283ab9ad9da7a2fd7e94de8d4e98e05e08059b396eb1235beb484a036cd82e9354da2cf1ed00b0204fe655fe77a0fef8706996b8e8f35e3
|
data/lib/language_filter.rb
CHANGED
@@ -63,7 +63,7 @@ module LanguageFilter
|
|
63
63
|
unless match == [nil] then
|
64
64
|
return true if @exceptionlist.empty? or not protected_by_exceptionlist?(match_start,match_end,text,start_at)
|
65
65
|
end
|
66
|
-
start_at = match_end + 1
|
66
|
+
start_at = match_end + 1 unless @exceptionlist.empty?
|
67
67
|
end
|
68
68
|
end
|
69
69
|
false
|
@@ -80,7 +80,7 @@ module LanguageFilter
|
|
80
80
|
unless match == [nil] then
|
81
81
|
words << match if @exceptionlist.empty? or not protected_by_exceptionlist?(match_start,match_end,text,start_at)
|
82
82
|
end
|
83
|
-
start_at = match_end + 1
|
83
|
+
start_at = match_end + 1 unless @exceptionlist.empty?
|
84
84
|
end
|
85
85
|
end
|
86
86
|
words.uniq
|
@@ -94,10 +94,10 @@ module LanguageFilter
|
|
94
94
|
match_start = text[start_at,text.size].index(/\b#{list_item}\b/i) unless @exceptionlist.empty?
|
95
95
|
match_end = match_start + match.size unless @exceptionlist.empty?
|
96
96
|
unless @exceptionlist.empty? or not protected_by_exceptionlist?(match_start,match_end,text,start_at) then
|
97
|
-
start_at = match_end + 1
|
97
|
+
start_at = match_end + 1 unless @exceptionlist.empty?
|
98
98
|
match
|
99
99
|
else
|
100
|
-
start_at = match_end + 1
|
100
|
+
start_at = match_end + 1 unless @exceptionlist.empty?
|
101
101
|
replace(match)
|
102
102
|
end
|
103
103
|
end
|