word_filter 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -7
- data/lib/word_filter.rb +3 -0
- data/lib/word_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: fef3450b9d3cc2242a70ee076f0c089d8e694544
|
4
|
+
data.tar.gz: 5f2b308d2663709e35e937eebcfe4e6222bbc7cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5361cc81361d90184dd339b5f6269b1aab86ba3d895b4f4a3419b4dc6d6c18c04c25839e30764078a011b1659d2d53d65fc454bf1c353bb6df364fe22441453
|
7
|
+
data.tar.gz: a01eb6fcae6e2d170933c7a3029da58f8d95ca56a3fbc2c86a8d7fafdf665ab9d1b3be672c67a81fb15b6f71a4a7d5e2201b16538fc0453bac390a596f185219
|
data/README.md
CHANGED
@@ -17,13 +17,14 @@ Or install it yourself as:
|
|
17
17
|
$ gem install word_filter
|
18
18
|
|
19
19
|
## Usage
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
This gem work with a dictionary list and a badwords list to be able to filter the bad words
|
21
|
+
|
22
|
+
Use example of the Gem
|
23
|
+
testFilter = WordFilter.new
|
24
|
+
testFilter.filterInit("lib/assets/dictionary.txt", "lib/assets/badwords.txt")
|
25
|
+
testFilter.filterLevel = WordFilter::SWAPPABLE_AND_REPEATED_VOWELS_INCLUDING_NONE
|
26
|
+
input = "I went to school and some beeeestard stole my lunch"
|
27
|
+
puts testFilter.filterString(input)
|
27
28
|
|
28
29
|
## Contributing
|
29
30
|
|
data/lib/word_filter.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "word_filter/version"
|
2
2
|
|
3
3
|
module WordFilter
|
4
|
+
class WordFilter
|
5
|
+
|
4
6
|
@@emailRegex = /[a-zA-Z0-9._%+-]+@[a-z0-9.-]+\\.[a-zA-Z]{2,4}/
|
5
7
|
@@alphaNumericDigit = /(zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|\d)/;
|
6
8
|
@@digitsRegex = Regexp.new("\b(\s*" + @@alphaNumericDigit.source + ")+\b")
|
@@ -177,4 +179,5 @@ module WordFilter
|
|
177
179
|
end
|
178
180
|
return result.join(" ")
|
179
181
|
end
|
182
|
+
end
|
180
183
|
end
|
data/lib/word_filter/version.rb
CHANGED