explicit_words 0.0.1
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 +7 -0
- data/.gitignore +18 -0
- data/.rspec +1 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +2 -0
- data/LICENSE +22 -0
- data/README.md +55 -0
- data/Rakefile +7 -0
- data/explicit_words.gemspec +27 -0
- data/lib/explicit_words.rb +16 -0
- data/lib/explicit_words.txt +108 -0
- data/lib/explicit_words/version.rb +5 -0
- data/spec/lib/explicit_words_spec.rb +28 -0
- data/spec/spec_helper.rb +2 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 83bf6618df359f8fd3977cc7216185c5dfa607a2
|
4
|
+
data.tar.gz: a13e4f2d168910215aca170efd8e6c62c9a26294
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 180ace81822ce26f1cca74f889d8fe9240e7bd91e6d2b36c52497eb1d052ee9f10a3d9053020a8a687e4080e15832ab1f5abe8e436c309d4dd39b5222f8b49c7
|
7
|
+
data.tar.gz: ca545f4619c6b66f24713291b22cb7de9d51b987430febbb66a6ba1a9791b3da2a200863415cf1ee79316ae830da73da4aa14d926fa5c854a9ba452220162c46
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color --format documentation
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Jonathan Underwood
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# ExplicitWords
|
2
|
+
|
3
|
+
[](https://travis-ci.org/jyunderwood/explicit_words)
|
4
|
+
|
5
|
+
A ruby library for dealing with content that may have explicit words in it.
|
6
|
+
|
7
|
+
Currently this gem is very rudimentary, and the only functionality it has is to return true or false if a given string has explicit words.
|
8
|
+
|
9
|
+
Used at [SixWordStories.com](http://sixwordstories.com).
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'explicit_words'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install explicit_words
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
explicit_content = "I'm wondering if this thing fucking works."
|
31
|
+
ExplicitWords.check(explicit_content) # => true
|
32
|
+
|
33
|
+
clean_content = "I'm sure it's working just fine."
|
34
|
+
ExplicitWords.check(clean_content) # => false
|
35
|
+
```
|
36
|
+
|
37
|
+
## TODO List
|
38
|
+
|
39
|
+
- Return a count of explicits
|
40
|
+
- Return content with explicits filtered/masked
|
41
|
+
- Allow users to configure a dictionary
|
42
|
+
- Allow for different storage options instead of a flat file
|
43
|
+
- Return a explicit percentage on a scale of 0.0 to 1.0
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create new Pull Request
|
52
|
+
|
53
|
+
## License
|
54
|
+
|
55
|
+
Licensed under the MIT License.
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'explicit_words/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'explicit_words'
|
8
|
+
spec.version = ExplicitWords::VERSION
|
9
|
+
spec.platform = Gem::Platform::RUBY
|
10
|
+
|
11
|
+
spec.summary = 'A ruby library for dealing with explicit words'
|
12
|
+
spec.description = 'A ruby library for dealing with content that may have explicit words in it.'
|
13
|
+
spec.homepage = 'https://github.com/jyunderwood/explicit_words'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.authors = ['Jonathan Underwood']
|
17
|
+
spec.email = ['jonathan@jyunderwood.com']
|
18
|
+
|
19
|
+
spec.files = `git ls-files`.split($/)
|
20
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'rspec'
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'explicit_words/version'
|
3
|
+
|
4
|
+
module ExplicitWords
|
5
|
+
EXPLICIT_WORDS = File.open(File.expand_path('../explicit_words.txt', __FILE__)).readlines.collect { |word| word.downcase.chomp }
|
6
|
+
|
7
|
+
def self.check(content)
|
8
|
+
explicit_content = false
|
9
|
+
|
10
|
+
content.scan(/[\w]+/).each do |word|
|
11
|
+
explicit_content = true if EXPLICIT_WORDS.include?(word.downcase)
|
12
|
+
end
|
13
|
+
|
14
|
+
explicit_content
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
ahole
|
2
|
+
anus
|
3
|
+
arse
|
4
|
+
ass
|
5
|
+
asshole
|
6
|
+
assholes
|
7
|
+
asswipe
|
8
|
+
bastard
|
9
|
+
bastards
|
10
|
+
bitch
|
11
|
+
bitches
|
12
|
+
blowjob
|
13
|
+
blowjobs
|
14
|
+
bollock
|
15
|
+
bollocks
|
16
|
+
boob
|
17
|
+
boobs
|
18
|
+
butthole
|
19
|
+
buttholes
|
20
|
+
buttwipe
|
21
|
+
buttwipes
|
22
|
+
clit
|
23
|
+
clits
|
24
|
+
cock
|
25
|
+
cockhead
|
26
|
+
cockheads
|
27
|
+
cocks
|
28
|
+
crap
|
29
|
+
crappy
|
30
|
+
cum
|
31
|
+
cunt
|
32
|
+
cunts
|
33
|
+
dick
|
34
|
+
dicks
|
35
|
+
dildo
|
36
|
+
dildos
|
37
|
+
dyke
|
38
|
+
dykes
|
39
|
+
fag
|
40
|
+
faggot
|
41
|
+
faggots
|
42
|
+
fags
|
43
|
+
fatass
|
44
|
+
fuck
|
45
|
+
fucker
|
46
|
+
fuckers
|
47
|
+
fuckin
|
48
|
+
fucking
|
49
|
+
fucks
|
50
|
+
gay
|
51
|
+
gays
|
52
|
+
jackoff
|
53
|
+
jackoffs
|
54
|
+
jizz
|
55
|
+
lesbian
|
56
|
+
lesbians
|
57
|
+
lesbo
|
58
|
+
lesbos
|
59
|
+
masturbate
|
60
|
+
motherfucker
|
61
|
+
motherfuckers
|
62
|
+
nigger
|
63
|
+
niggers
|
64
|
+
nutsack
|
65
|
+
orgasm
|
66
|
+
pecker
|
67
|
+
penis
|
68
|
+
porn
|
69
|
+
pussy
|
70
|
+
queef
|
71
|
+
queer
|
72
|
+
queers
|
73
|
+
retard
|
74
|
+
retards
|
75
|
+
schlong
|
76
|
+
semen
|
77
|
+
sex
|
78
|
+
sexy
|
79
|
+
shemale
|
80
|
+
shemales
|
81
|
+
shit
|
82
|
+
shits
|
83
|
+
shitter
|
84
|
+
shitty
|
85
|
+
skank
|
86
|
+
skanks
|
87
|
+
skanky
|
88
|
+
slut
|
89
|
+
sluts
|
90
|
+
slutty
|
91
|
+
smut
|
92
|
+
testicle
|
93
|
+
testicles
|
94
|
+
tit
|
95
|
+
tits
|
96
|
+
turd
|
97
|
+
twat
|
98
|
+
twats
|
99
|
+
vagina
|
100
|
+
vulva
|
101
|
+
wank
|
102
|
+
wanker
|
103
|
+
wankers
|
104
|
+
wetback
|
105
|
+
wetbacks
|
106
|
+
whore
|
107
|
+
whores
|
108
|
+
xxx
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe ExplicitWords do
|
5
|
+
|
6
|
+
let(:explicit_content) { "I'm wondering if this thing fucking works." }
|
7
|
+
let(:clean_content) { "I'm sure it's working just fine." }
|
8
|
+
|
9
|
+
describe '#check' do
|
10
|
+
context 'when content has explicits' do
|
11
|
+
it 'returns true' do
|
12
|
+
expect(ExplicitWords.check(explicit_content)).to eq true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when content has explicits of varying case' do
|
17
|
+
it 'returns true' do
|
18
|
+
expect(ExplicitWords.check('FuCK')).to eq true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when content does not have explicits' do
|
23
|
+
it 'returns false' do
|
24
|
+
expect(ExplicitWords.check(clean_content)).to eq false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: explicit_words
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonathan Underwood
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: A ruby library for dealing with content that may have explicit words
|
56
|
+
in it.
|
57
|
+
email:
|
58
|
+
- jonathan@jyunderwood.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .gitignore
|
64
|
+
- .rspec
|
65
|
+
- .travis.yml
|
66
|
+
- CHANGELOG.md
|
67
|
+
- Gemfile
|
68
|
+
- LICENSE
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- explicit_words.gemspec
|
72
|
+
- lib/explicit_words.rb
|
73
|
+
- lib/explicit_words.txt
|
74
|
+
- lib/explicit_words/version.rb
|
75
|
+
- spec/lib/explicit_words_spec.rb
|
76
|
+
- spec/spec_helper.rb
|
77
|
+
homepage: https://github.com/jyunderwood/explicit_words
|
78
|
+
licenses:
|
79
|
+
- MIT
|
80
|
+
metadata: {}
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.0.3
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: A ruby library for dealing with explicit words
|
101
|
+
test_files:
|
102
|
+
- spec/lib/explicit_words_spec.rb
|
103
|
+
- spec/spec_helper.rb
|