word_filter 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 218ff49c9187c5a6a3baa6837d930ca128d3406d
4
- data.tar.gz: 37bbb6429d7fcdb56dd3d2c8ec17eb8bf7ca5f12
3
+ metadata.gz: fef3450b9d3cc2242a70ee076f0c089d8e694544
4
+ data.tar.gz: 5f2b308d2663709e35e937eebcfe4e6222bbc7cd
5
5
  SHA512:
6
- metadata.gz: 09d96996dbf4a356a54bce7892214a6661b4effdfaefec95424e5cd6da5cb93df95266cafe1478f4d3085489c7f4cc49fc0c39b5947abc9a7fad3b29c959f412
7
- data.tar.gz: b08d8f7a70ae5e1a819db5ac9882a1dc1d7ab31c69ac2638285c97034a897adb971f51d7edd73d152b69de93483342ca978dcb7795adb55e0b6ca2ad648079dd
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
- # Use example of the class
22
- # testFilter = WordFilter.new
23
- # testFilter.filterInit("lib/assets/dictionary.txt", "lib/assets/badwords.txt")
24
- # testFilter.filterLevel = WordFilter::SWAPPABLE_AND_REPEATED_VOWELS_INCLUDING_NONE
25
- # input = "I went to school and some beeeestard stole my lunch"
26
- # puts testFilter.filterString(input)
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
@@ -1,3 +1,3 @@
1
1
  module WordFilter
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huascar Oña