linter 0.1.7 → 0.1.8
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.lock +1 -1
- data/data/gender_association_wordlist.yml +112 -111
- data/data/mindset_wordlist.yml +26 -0
- data/data/misused_wordlist.yml +30 -0
- data/data/pronoun_association_wordlist.yml +11 -10
- data/lib/linter.rb +1 -0
- data/lib/linter/base_association.rb +7 -11
- data/lib/linter/mindset_association.rb +28 -0
- data/lib/linter/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d37fc2c12261ce9fc63abee6bc787ae37fceb65591e8d77daf4d363d3b5e237
|
4
|
+
data.tar.gz: 72fe17fd2674c5fb5b7f280c4b122f79e0b5f28d30bb054cee844d348392bf67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f3c1029a82a2e886080341d60573a1a89397ae6561254ff07d06e7a2100adc7ee39efdc8dd47318bee85a1342797b7c3263d1059ff0bac8bd11c125e46ea937
|
7
|
+
data.tar.gz: 914afdd6cf0a6d3a2d1f1e7f409fa754c8d7238079404ebb29dbea626ae12672e60fe75d1699d446cc0cae8b631f7d0e887a84207d6c1e156378a453f0d104b1
|
data/Gemfile.lock
CHANGED
@@ -1,112 +1,113 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
words:
|
2
|
+
feminine_coded:
|
3
|
+
- agree
|
4
|
+
- affectionate
|
5
|
+
- child*
|
6
|
+
- cheer
|
7
|
+
- collab
|
8
|
+
- commit
|
9
|
+
- communal
|
10
|
+
- compassion
|
11
|
+
- connect
|
12
|
+
- considerate
|
13
|
+
- cooperat
|
14
|
+
- co-operat
|
15
|
+
- depend
|
16
|
+
- emotiona
|
17
|
+
- empath
|
18
|
+
- feel
|
19
|
+
- flatterable
|
20
|
+
- gentle
|
21
|
+
- honest
|
22
|
+
- interpersonal
|
23
|
+
- interdependen
|
24
|
+
- interpersona
|
25
|
+
- inter-personal
|
26
|
+
- inter-dependen
|
27
|
+
- inter-persona
|
28
|
+
- kind
|
29
|
+
- kinship
|
30
|
+
- loyal
|
31
|
+
- modesty
|
32
|
+
- nag
|
33
|
+
- nurtur
|
34
|
+
- pleasant
|
35
|
+
- polite
|
36
|
+
- quiet*
|
37
|
+
- respon
|
38
|
+
- sensitiv
|
39
|
+
- submissive
|
40
|
+
- support
|
41
|
+
- sympath
|
42
|
+
- tender
|
43
|
+
- together
|
44
|
+
- trust
|
45
|
+
- understand
|
46
|
+
- warm
|
47
|
+
- whin
|
48
|
+
- enthusias
|
49
|
+
- inclusive
|
50
|
+
- yield
|
51
|
+
- share
|
52
|
+
- sharin
|
52
53
|
|
53
|
-
masculine_coded:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
54
|
+
masculine_coded:
|
55
|
+
- active
|
56
|
+
- adventurous
|
57
|
+
- aggress
|
58
|
+
- ambitio
|
59
|
+
- analytics
|
60
|
+
- analy
|
61
|
+
- assert
|
62
|
+
- athlet
|
63
|
+
- autonom
|
64
|
+
- battle
|
65
|
+
- boast
|
66
|
+
- challeng
|
67
|
+
- champion
|
68
|
+
- compet
|
69
|
+
- confident
|
70
|
+
- courag
|
71
|
+
- decid
|
72
|
+
- decision
|
73
|
+
- decisive
|
74
|
+
- defend
|
75
|
+
- determin
|
76
|
+
- domina
|
77
|
+
- dominant
|
78
|
+
- driven
|
79
|
+
- fearless
|
80
|
+
- fight
|
81
|
+
- force
|
82
|
+
- guys
|
83
|
+
- greedy
|
84
|
+
- head-strong
|
85
|
+
- headstrong
|
86
|
+
- hierarch
|
87
|
+
- hostil
|
88
|
+
- impulsive
|
89
|
+
- independen
|
90
|
+
- individual
|
91
|
+
- intellect
|
92
|
+
- lead
|
93
|
+
- logic
|
94
|
+
- manpower
|
95
|
+
- manning
|
96
|
+
- middleman
|
97
|
+
- ninja
|
98
|
+
- objective
|
99
|
+
- opinion
|
100
|
+
- outspoken
|
101
|
+
- persist
|
102
|
+
- principle
|
103
|
+
- reckless
|
104
|
+
- rockstar
|
105
|
+
- self-confiden
|
106
|
+
- self-relian
|
107
|
+
- self-sufficien
|
108
|
+
- selfconfiden
|
109
|
+
- selfrelian
|
110
|
+
- selfsufficien
|
111
|
+
- stubborn
|
112
|
+
- superior
|
113
|
+
- unreasonab
|
@@ -0,0 +1,26 @@
|
|
1
|
+
words:
|
2
|
+
growth_coded:
|
3
|
+
- striving
|
4
|
+
- driven
|
5
|
+
- highly motivated
|
6
|
+
- improvement
|
7
|
+
- learn
|
8
|
+
- strive
|
9
|
+
- grow
|
10
|
+
- persevere
|
11
|
+
- determined
|
12
|
+
|
13
|
+
fixed_coded:
|
14
|
+
- est
|
15
|
+
- brightest
|
16
|
+
- smart
|
17
|
+
- performer
|
18
|
+
- intelligent
|
19
|
+
- rockstar
|
20
|
+
- superhero
|
21
|
+
- genius
|
22
|
+
- expert
|
23
|
+
- brilliant
|
24
|
+
- natural
|
25
|
+
- talent
|
26
|
+
- overachieve
|
data/data/misused_wordlist.yml
CHANGED
@@ -132,3 +132,33 @@ problematic:
|
|
132
132
|
replace_with:
|
133
133
|
- If you are using it as a descriptor for a person with an intellectual disability in a context where such a descriptor is necessary, you could replace it with a term that does not have the same derogatory connotation, or the name of the actual disability if relevant.
|
134
134
|
- If you are using it to insult someone (e.g. "You're such a retard") then don't.
|
135
|
+
- word: blacklist
|
136
|
+
reason: |
|
137
|
+
Black is too often used in a negative context (with the opposite being
|
138
|
+
referred to as white). Please consider using alternatives when they convey
|
139
|
+
the same meaning.
|
140
|
+
replace_with:
|
141
|
+
- blocklist
|
142
|
+
- word: whitelist
|
143
|
+
reason: |
|
144
|
+
Black & white are often used in contexts where white is the positive item,
|
145
|
+
and black the negative item. Please consider using alternatives when they
|
146
|
+
convey the same meaning.
|
147
|
+
replace_with:
|
148
|
+
- allowlist
|
149
|
+
- word: master
|
150
|
+
reason: |
|
151
|
+
Master (in context of master/slave) is often used in computer terminology
|
152
|
+
when leader/follower, or primary/replica are as meaningful and don't have
|
153
|
+
a connotation of slavery.
|
154
|
+
replace_with:
|
155
|
+
- leader
|
156
|
+
- primary
|
157
|
+
- word: slave
|
158
|
+
reason: |
|
159
|
+
Master (in context of master/slave) is often used in computer terminology
|
160
|
+
when leader/follower, or primary/replica are as meaningful and don't have
|
161
|
+
a connotation of slavery.
|
162
|
+
replace_with:
|
163
|
+
- follower
|
164
|
+
- replica
|
data/lib/linter.rb
CHANGED
@@ -3,18 +3,14 @@
|
|
3
3
|
module Linter
|
4
4
|
class BaseAssociation
|
5
5
|
def self.analyze(text)
|
6
|
-
result = OpenStruct.new(
|
7
|
-
feminine_coded_word_counts: {},
|
8
|
-
masculine_coded_word_counts: {},
|
9
|
-
trend: ''
|
10
|
-
)
|
6
|
+
result = OpenStruct.new(trend: '')
|
11
7
|
|
12
|
-
wordlists
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
wordlists.dig('words').each do |key, words|
|
9
|
+
word_count_key = "#{key}_word_counts".to_sym
|
10
|
+
result[word_count_key] = {}
|
11
|
+
words.each do |word|
|
12
|
+
result.send(word_count_key).merge!(word_count(text, word))
|
13
|
+
end
|
18
14
|
end
|
19
15
|
|
20
16
|
result.trend = calculate_trend(result)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Linter
|
4
|
+
class MindsetAssociation < BaseAssociation
|
5
|
+
USE_FOR_JOB_ADS = true
|
6
|
+
FULL_WORD = false
|
7
|
+
|
8
|
+
def self.wordlists
|
9
|
+
file_path = File.join(__dir__, '../../data/mindset_wordlist.yml')
|
10
|
+
@wordlists ||= YAML.load_file(file_path)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.calculate_trend(result)
|
14
|
+
case result.fixed_coded_word_counts.values.sum - result.growth_coded_word_counts.values.sum
|
15
|
+
when 0
|
16
|
+
'neutral'
|
17
|
+
when 1..3
|
18
|
+
'growth-coded'
|
19
|
+
when 3..Float::INFINITY
|
20
|
+
'strongly growth-coded'
|
21
|
+
when -Float::INFINITY..-3
|
22
|
+
'strongly fixed-coded'
|
23
|
+
else
|
24
|
+
'fixed-coded'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/linter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lien van den steen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -132,12 +132,14 @@ files:
|
|
132
132
|
- bin/linter
|
133
133
|
- bin/setup
|
134
134
|
- data/gender_association_wordlist.yml
|
135
|
+
- data/mindset_wordlist.yml
|
135
136
|
- data/misused_wordlist.yml
|
136
137
|
- data/pronoun_association_wordlist.yml
|
137
138
|
- lib/linter.rb
|
138
139
|
- lib/linter/base_association.rb
|
139
140
|
- lib/linter/cli.rb
|
140
141
|
- lib/linter/gender_association.rb
|
142
|
+
- lib/linter/mindset_association.rb
|
141
143
|
- lib/linter/misused_words.rb
|
142
144
|
- lib/linter/pronoun_association.rb
|
143
145
|
- lib/linter/version.rb
|