profanity-filter 0.1.2 → 0.1.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/Gemfile +0 -1
- data/Gemfile.lock +2 -2
- data/README.md +2 -8
- data/bin/console +1 -1
- data/lib/{profanity_dictionaries → profanity-dictionaries}/en.yaml +0 -0
- data/lib/{profanity_dictionaries → profanity-dictionaries}/es.yaml +0 -0
- data/lib/{profanity_dictionaries → profanity-dictionaries}/leet_strategy_dictionary.yaml +0 -0
- data/lib/{profanity_dictionaries → profanity-dictionaries}/partial_match.yaml +0 -0
- data/lib/{profanity_dictionaries → profanity-dictionaries}/pt.yaml +0 -0
- data/lib/{profanity_filter.rb → profanity-filter.rb} +7 -7
- data/lib/{profanity_filter → profanity-filter}/engines/allow_duplicate_characters_strategy.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/engines/allow_symbols_in_words_strategy.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/engines/component.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/engines/composite.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/engines/exact_match_strategy.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/engines/leet_exact_match_strategy.rb +1 -1
- data/lib/{profanity_filter → profanity-filter}/engines/partial_match_strategy.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/engines/regexp_strategy.rb +0 -0
- data/lib/{profanity_filter → profanity-filter}/version.rb +1 -1
- data/{profanity_filter.gemspec → profanity-filter.gemspec} +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2577d7d8d090b82467c6d2f002067d3d41d2e779f7e31b5813ce3709ff13b09a
|
|
4
|
+
data.tar.gz: a9644450904f18d2261b8d86a4be3696dd4e675d9a4fb87fefa7d6ee98ec47c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 189dab97e9065eed4da6ff0013dad4d63234ef271ac5cb31f16dd4a1631558e76a21b4bd4614b15191156ee643007948f3422ff88eb108827d7ac63e453b5e81
|
|
7
|
+
data.tar.gz: 2ece6bd1a9910ef30c969c85e266ccec7ec128395b649e0386feb18db10d52926be7a94ce4fd911995981088f37c34e1e91f9acb866e2769fbbf906e21c3f4ff
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
profanity-filter (0.1.
|
|
4
|
+
profanity-filter (0.1.2)
|
|
5
5
|
webpurify
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
coderay (1.1.2)
|
|
11
|
-
json (2.
|
|
11
|
+
json (2.1.0)
|
|
12
12
|
method_source (0.9.2)
|
|
13
13
|
minitest (5.11.3)
|
|
14
14
|
pry (0.12.2)
|
data/README.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
# ProfanityFilter
|
|
2
|
-
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/profanity-filter`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
6
|
-
|
|
7
1
|
## Installation
|
|
8
2
|
|
|
9
3
|
Add this line to your application's Gemfile:
|
|
@@ -26,7 +20,7 @@ Or install it yourself as:
|
|
|
26
20
|
# without WebPurify
|
|
27
21
|
pf = ProfanityFilter.new
|
|
28
22
|
# with WebPurify
|
|
29
|
-
pf = ProfanityFilter.new(
|
|
23
|
+
pf = ProfanityFilter.new(web_purifier_api_key: [YOUR-API-KEY])
|
|
30
24
|
|
|
31
25
|
pf.profane? ('ssssshit')
|
|
32
26
|
# => true
|
|
@@ -51,4 +45,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
51
45
|
|
|
52
46
|
## Code of Conduct
|
|
53
47
|
|
|
54
|
-
Everyone interacting in the ProfanityFilter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
48
|
+
Everyone interacting in the ProfanityFilter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cardinalblue/profanity-filter/blob/master/CODE_OF_CONDUCT.md).
|
data/bin/console
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
4
|
-
require '
|
|
5
|
-
require '
|
|
6
|
-
require '
|
|
7
|
-
require '
|
|
8
|
-
require '
|
|
3
|
+
require 'profanity-filter/version'
|
|
4
|
+
require 'profanity-filter/engines/composite'
|
|
5
|
+
require 'profanity-filter/engines/partial_match_strategy'
|
|
6
|
+
require 'profanity-filter/engines/allow_duplicate_characters_strategy'
|
|
7
|
+
require 'profanity-filter/engines/allow_symbols_in_words_strategy'
|
|
8
|
+
require 'profanity-filter/engines/leet_exact_match_strategy'
|
|
9
9
|
require 'web_purify'
|
|
10
10
|
|
|
11
11
|
class ProfanityFilter
|
|
@@ -140,7 +140,7 @@ class ProfanityFilter
|
|
|
140
140
|
|
|
141
141
|
def load_dictionary(file_path)
|
|
142
142
|
dir = File.dirname(__FILE__)
|
|
143
|
-
YAML.load(File.read("#{dir}/
|
|
143
|
+
YAML.load(File.read("#{dir}/profanity-dictionaries/#{file_path}.yaml"))
|
|
144
144
|
end
|
|
145
145
|
|
|
146
146
|
def load_exact_match_dictionary
|
data/lib/{profanity_filter → profanity-filter}/engines/allow_duplicate_characters_strategy.rb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -23,7 +23,7 @@ module ProfanityFilterEngine
|
|
|
23
23
|
|
|
24
24
|
def build_leet_dictionary
|
|
25
25
|
lib_dir = File.expand_path('../../../', __FILE__)
|
|
26
|
-
file = File.read("#{lib_dir}/
|
|
26
|
+
file = File.read("#{lib_dir}/profanity-dictionaries/leet_strategy_dictionary.yaml")
|
|
27
27
|
raw_data = YAML.safe_load(file)
|
|
28
28
|
dict = transform_data_to_regex(raw_data)
|
|
29
29
|
::ProfanityFilterEngine::LeetExactMatchStrategy.const_set('LEET_DICTIONARY', dict)
|
|
File without changes
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: profanity-filter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maso Lin
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-07-
|
|
12
|
+
date: 2019-07-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: webpurify
|
|
@@ -116,22 +116,22 @@ files:
|
|
|
116
116
|
- Rakefile
|
|
117
117
|
- bin/console
|
|
118
118
|
- bin/setup
|
|
119
|
-
- lib/
|
|
120
|
-
- lib/
|
|
121
|
-
- lib/
|
|
122
|
-
- lib/
|
|
123
|
-
- lib/
|
|
124
|
-
- lib/
|
|
125
|
-
- lib/
|
|
126
|
-
- lib/
|
|
127
|
-
- lib/
|
|
128
|
-
- lib/
|
|
129
|
-
- lib/
|
|
130
|
-
- lib/
|
|
131
|
-
- lib/
|
|
132
|
-
- lib/
|
|
133
|
-
- lib/
|
|
134
|
-
-
|
|
119
|
+
- lib/profanity-dictionaries/en.yaml
|
|
120
|
+
- lib/profanity-dictionaries/es.yaml
|
|
121
|
+
- lib/profanity-dictionaries/leet_strategy_dictionary.yaml
|
|
122
|
+
- lib/profanity-dictionaries/partial_match.yaml
|
|
123
|
+
- lib/profanity-dictionaries/pt.yaml
|
|
124
|
+
- lib/profanity-filter.rb
|
|
125
|
+
- lib/profanity-filter/engines/allow_duplicate_characters_strategy.rb
|
|
126
|
+
- lib/profanity-filter/engines/allow_symbols_in_words_strategy.rb
|
|
127
|
+
- lib/profanity-filter/engines/component.rb
|
|
128
|
+
- lib/profanity-filter/engines/composite.rb
|
|
129
|
+
- lib/profanity-filter/engines/exact_match_strategy.rb
|
|
130
|
+
- lib/profanity-filter/engines/leet_exact_match_strategy.rb
|
|
131
|
+
- lib/profanity-filter/engines/partial_match_strategy.rb
|
|
132
|
+
- lib/profanity-filter/engines/regexp_strategy.rb
|
|
133
|
+
- lib/profanity-filter/version.rb
|
|
134
|
+
- profanity-filter.gemspec
|
|
135
135
|
homepage: https://github.com/cardinalblue/profanity-filter
|
|
136
136
|
licenses:
|
|
137
137
|
- MIT
|