profanity-filter 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +21 -0
- data/lib/profanity-filter/engines/leet_exact_match_strategy.rb +0 -1
- data/lib/profanity-filter/version.rb +1 -1
- data/profanity-filter.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37f63a8273bf8fd2020d986fb9388e8bda853667c6d81577ba09a32db235f17b
|
4
|
+
data.tar.gz: 90b73051145aed17a064fd02f77452689c78a921f137438c2008a2ce648b094e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6366ac28841bb359b6bf884b8a8d97b45e3fb7a4fe66cb6240a32e032952f3a92786f21ac581f78f8a60bf2340000efc31b21aefe4be3104d8be2906a39c620c
|
7
|
+
data.tar.gz: de01d8b3c3e1428ec4dc6f684dd0e625ccbcf2d3682bdfef524424a0283e51b2d94e19e36675e0314ebea9290d3cef326880390e3dfa01d434d1d7a3fe043118
|
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.4)
|
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.2.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,3 +1,20 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/profanity-filter.svg)](https://badge.fury.io/rb/profanity-filter)
|
2
|
+
|
3
|
+
## Profanity Filter
|
4
|
+
Strategies to publish offensive texts online can be roughly grouped into 5 categories:
|
5
|
+
1. Similarities, eg. b ⇔ 6
|
6
|
+
2. Diacritics(sound alteration), eg. u ⇔ ü, ù, ú
|
7
|
+
3. Constructions(multi-part), eg. W ⇔ VV, V ⇔ \/
|
8
|
+
4. Injections, eg. s-h-i-t, shhhhhhhhhhhit
|
9
|
+
5. Unicode(same shape but different unicode), eg ⒜, ⍺, a, 𝐚, 𝑎, 𝒂, 𝒶, 𝓪, 𝔞, 𝕒, 𝖆, 𝖺, 𝗮, 𝘢, 𝙖
|
10
|
+
|
11
|
+
This profanity filter implements:
|
12
|
+
- [Full Support] diacritics, injections, unicode
|
13
|
+
- [Partial Support] similarities, constructions
|
14
|
+
|
15
|
+
This gem is also integrated with [Web Purify](https://www.webpurify.com). Usage example below.
|
16
|
+
|
17
|
+
|
1
18
|
## Installation
|
2
19
|
|
3
20
|
Add this line to your application's Gemfile:
|
@@ -19,6 +36,7 @@ Or install it yourself as:
|
|
19
36
|
```ruby
|
20
37
|
# without WebPurify
|
21
38
|
pf = ProfanityFilter.new
|
39
|
+
|
22
40
|
# with WebPurify
|
23
41
|
pf = ProfanityFilter.new(web_purifier_api_key: [YOUR-API-KEY])
|
24
42
|
|
@@ -46,3 +64,6 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
46
64
|
## Code of Conduct
|
47
65
|
|
48
66
|
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).
|
67
|
+
|
68
|
+
## Todo
|
69
|
+
pluggable logging and strategies
|
data/profanity-filter.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'profanity-filter/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'profanity-filter'
|
7
7
|
spec.version = ProfanityFilter::VERSION
|
8
|
-
spec.authors = ['Maso Lin', 'Jenny Shih']
|
8
|
+
spec.authors = ['Maso Lin', 'Jenny Shih', 'YenTing Chen']
|
9
9
|
spec.email = ['dev@cardinalblue.com']
|
10
10
|
|
11
11
|
spec.summary = 'To detect if a given string contains profane words.'
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maso Lin
|
8
8
|
- Jenny Shih
|
9
|
+
- YenTing Chen
|
9
10
|
autorequire:
|
10
11
|
bindir: exe
|
11
12
|
cert_chain: []
|
12
|
-
date: 2019-07-
|
13
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: webpurify
|