elib_mgmt-cli 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/.release_history.yml +2 -0
- data/Gemfile.lock +1 -1
- data/lib/elib_mgmt/cli/file_filter.rb +56 -81
- data/lib/elib_mgmt/cli/version.rb +1 -1
- data/mapping.yml +113 -98
- data/regex_test.rb +49 -30
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 025705c805e91c33ce145ca3b8c01440ce373a40eceab833c30cd614d5159a75
|
4
|
+
data.tar.gz: 3edb91b2177bc56449fc2de91510328aecbe8b97fe3fa9b8ed1e6671a14d7a82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fc2f84f9bc5e126ea07765acc14bfaf985348ff157352f1b689021a76e35b3ee240f6d237c3aeb9dfcfe96e8ed06c9305303847625e5992870aa0eeed82856e
|
7
|
+
data.tar.gz: ad669b3fd1ba05b1365743b4c0414b799483b0bc82a19e7c6d5a2452b6ad44d3668d31036737520bbedcd3c32f3d57cb68626794ef42d15a62fb6a9b79b5974e
|
data/.release_history.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -24,54 +24,55 @@ module ElibMgmt
|
|
24
24
|
[]
|
25
25
|
else
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
}
|
27
|
+
spec = []
|
28
|
+
#if name.include?("*")
|
30
29
|
|
31
|
-
|
30
|
+
# found = Dir.glob(File.join(@base_path, pattern)).reject { |f| File.directory?(f) }.select { |v|
|
32
31
|
|
33
|
-
|
34
|
-
|
32
|
+
# vv = File.basename(v, File.extname(v)).downcase
|
33
|
+
# spec = name.downcase.gsub("*","\\w*")
|
35
34
|
|
36
|
-
|
35
|
+
# # beginning
|
36
|
+
# # exact match
|
37
|
+
# vv =~ /^#{spec}\z/i or
|
38
|
+
# # match starting with keyword
|
39
|
+
# vv =~ /^#{spec}[-,.,_,\s]/i or
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
when :strict
|
42
|
-
#@logger.odebug "Word with '*' '#{name}' strict mode"
|
43
|
-
vv =~ /[\(,-,_,.,\s]#{spec}[\),-,_,.,\s]/i or
|
44
|
-
vv =~ /^#{spec}#{SPat}/i or
|
45
|
-
vv =~ /#{SPat}#{spec}\z/i
|
46
|
-
else
|
47
|
-
#@logger.odebug "Word with '*' '#{name}' relax mode"
|
48
|
-
vv =~ /#{SPat}#{spec}#{SPat}/i or
|
49
|
-
vv =~ /#{SPat}#{spec}/i or
|
50
|
-
vv =~ /#{spec}#{SPat}/i
|
51
|
-
end
|
41
|
+
# # middle
|
42
|
+
# vv =~ /[-,.,_,|,\s,\W]#{spec}[-,.,_,|,\s,\W]/i or
|
43
|
+
# #vv =~ /[-,.,_,\s]#{spec}[-,.,_,\s]/i or
|
52
44
|
|
53
|
-
|
45
|
+
# # ending
|
46
|
+
# vv =~ /[-,.,_,\s]#{spec}\z/i or
|
47
|
+
# vv =~ /[-,.,_,\s,\[,\(]#{spec}[\],\)]/i
|
48
|
+
# #vv =~ /[-,.,_,\s]#{spec}\z/i
|
54
49
|
|
55
|
-
|
50
|
+
# }
|
51
|
+
|
52
|
+
#elsif name.include?(" ")
|
53
|
+
if name.include?(" ")
|
56
54
|
|
57
|
-
pname = name.split(" ").map { |v| "#{v}" }
|
58
|
-
spec = pname.join(
|
55
|
+
pname = name.split(" ").map { |v| "#{v.downcase}" }
|
56
|
+
spec = pname.join("[-,.,_,|,\s,\W]")
|
59
57
|
|
60
58
|
found = Dir.glob(File.join(@base_path, pattern)).reject { |f| File.directory?(f) }.select { |v|
|
61
59
|
|
62
|
-
vv = File.basename(v)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
60
|
+
vv = File.basename(v, File.extname(v)).downcase
|
61
|
+
|
62
|
+
# beginning
|
63
|
+
# exact match
|
64
|
+
vv =~ /^#{spec}\z/i or
|
65
|
+
# match starting with keyword
|
66
|
+
vv =~ /^#{spec}[-,.,_,\s\W]/i or
|
67
|
+
|
68
|
+
# middle
|
69
|
+
vv =~ /[-,.,_,|,\s,\W]#{spec}[-,.,_,|,\s,\W]/i or
|
70
|
+
#vv =~ /[-,.,_,\s]#{spec}[-,.,_,\s]/i or
|
71
|
+
|
72
|
+
# ending
|
73
|
+
vv =~ /[-,.,_,\s]#{spec}\z/i or
|
74
|
+
#vv =~ /[-,.,_,\s,\[,\(]#{spec}[\],\)]/i
|
75
|
+
vv =~ /[-,.,_,|,\s,\W]#{spec}[-,.,_,|,\s,\W]\z/i
|
75
76
|
|
76
77
|
}
|
77
78
|
|
@@ -81,59 +82,33 @@ module ElibMgmt
|
|
81
82
|
# single word
|
82
83
|
found = Dir.glob(File.join(@base_path, pattern)).reject { |f| File.directory?(f) }.select { |v|
|
83
84
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
85
|
+
spec = name.downcase
|
86
|
+
vv = File.basename(v, File.extname(v)).downcase
|
87
|
+
|
88
|
+
# beginning
|
89
|
+
# exact match
|
90
|
+
vv =~ /^#{spec}\z/i or
|
91
|
+
# match starting with keyword
|
92
|
+
vv =~ /^#{spec}[-,.,_,\s,\W]/i or
|
93
|
+
|
94
|
+
# middle
|
95
|
+
vv =~ /[-,.,_,|,\s,\W]#{spec}[-,.,_,|,\s,\W]/i or
|
96
|
+
#vv =~ /[-,.,_,\s]#{name}[-,.,_,\s]/i or
|
97
|
+
|
98
|
+
# ending
|
99
|
+
vv =~ /[-,.,_,\s,\W]#{spec}\z/i or
|
100
|
+
#vv =~ /[-,.,_,\s,\[,\(]#{name}[\],\)]/i
|
101
|
+
vv =~ /[-,.,_,|,\s,\W]#{spec}[-,.,_,|,\s,\W]\z/i
|
95
102
|
|
96
103
|
}
|
97
104
|
|
98
105
|
end
|
99
106
|
|
100
|
-
#if name.include?(" ")
|
101
|
-
|
102
|
-
# ["-","_","."].each do |c|
|
103
|
-
# key = name.downcase.split(" ")
|
104
|
-
# res = Dir.glob(File.join(@base_path, pattern)).reject { |f| File.directory?(f) }.select { |v|
|
105
|
-
# n = File.basename(v, File.extname(v)).downcase
|
106
|
-
# (key - n.split(" ").map(&:strip)).empty? || (key - n.split("-").map(&:strip)).empty? || (key - n.split("_").map(&:strip)).empty? || (key - n.split(".").map(&:strip)).empty?
|
107
|
-
# }
|
108
|
-
# found += res
|
109
|
-
# end
|
110
|
-
|
111
|
-
#else
|
112
|
-
|
113
|
-
# key = name.downcase
|
114
|
-
# res = Dir.glob(File.join(@base_path, pattern)).reject { |f| File.directory?(f) }.select { |v|
|
115
|
-
# n = File.basename(v, File.extname(v)).downcase
|
116
|
-
# n.split(" ").map(&:strip).include?(key) || n.split("-").map(&:strip).include?(key) || n.split("_").map(&:strip).include?(key) || n.split(".").map(&:strip).include?(key)
|
117
|
-
# }
|
118
|
-
# found += res
|
119
|
-
|
120
|
-
#end
|
121
|
-
|
122
|
-
#found.uniq
|
123
107
|
found
|
124
108
|
end
|
125
109
|
|
126
110
|
end
|
127
111
|
|
128
|
-
private
|
129
|
-
def const_pattern(val)
|
130
|
-
[
|
131
|
-
"#{SPat}#{val}#{SPat}",
|
132
|
-
"#{SPat}#{val}",
|
133
|
-
"#{val}#{SPat}"
|
134
|
-
]
|
135
|
-
end
|
136
|
-
|
137
112
|
|
138
113
|
end
|
139
114
|
end
|
data/mapping.yml
CHANGED
@@ -2,36 +2,34 @@
|
|
2
2
|
|
3
3
|
---
|
4
4
|
"config":
|
5
|
-
"reset_before_sort":
|
5
|
+
"reset_before_sort": false
|
6
6
|
:sort_spec:
|
7
7
|
- :outdir: "R"
|
8
8
|
:matcher:
|
9
|
-
- "r"
|
10
|
-
:mode: :strict
|
9
|
+
- "r"
|
11
10
|
- :outdir: "Design related"
|
12
11
|
:matcher:
|
13
|
-
- "design"
|
12
|
+
- "design\\w*"
|
14
13
|
- "ux"
|
15
14
|
- "user experience"
|
16
|
-
- "designing interfaces"
|
17
15
|
- :outdir: "Javascript"
|
18
16
|
:matcher:
|
19
17
|
- "javascript"
|
20
18
|
- "d3"
|
21
19
|
- "ext-js"
|
22
|
-
- "
|
20
|
+
- "highcharts"
|
23
21
|
- :outdir: "Javascript/jQuery"
|
24
22
|
:matcher:
|
25
23
|
- "jquery"
|
26
24
|
- :outdir: "Javascript/React"
|
27
25
|
:matcher:
|
28
|
-
- "react"
|
26
|
+
- "react\\w*"
|
29
27
|
- :outdir: "Javascript/Vue"
|
30
28
|
:matcher:
|
31
|
-
- "vue"
|
29
|
+
- "vue\\w*"
|
32
30
|
- :outdir: "Javascript/Node"
|
33
31
|
:matcher:
|
34
|
-
- "node"
|
32
|
+
- "node\\w*"
|
35
33
|
- :outdir: "Blockchain"
|
36
34
|
:matcher:
|
37
35
|
- "blockchain"
|
@@ -42,47 +40,53 @@
|
|
42
40
|
- "ada"
|
43
41
|
- :outdir: "Security"
|
44
42
|
:matcher:
|
45
|
-
- "secur*"
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
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
|
-
-
|
43
|
+
- "secur\\w*"
|
44
|
+
- "tls"
|
45
|
+
- "ssl"
|
46
|
+
- "crypto\\w*"
|
47
|
+
- "threat[s]*"
|
48
|
+
- "malware[s]*"
|
49
|
+
- "penetration[s]*"
|
50
|
+
- "reverse"
|
51
|
+
- "bounty"
|
52
|
+
- "offensive"
|
53
|
+
- "ethical"
|
54
|
+
- "forensic[s]*"
|
55
|
+
- "crack\\w*"
|
56
|
+
- "hack\\w*"
|
57
|
+
- "cybercrime"
|
58
|
+
- "attack\\w*"
|
59
|
+
- "defend[s]*"
|
60
|
+
- "defense[s]*"
|
61
|
+
- "dark web"
|
62
|
+
- "darkmarket"
|
63
|
+
- "trustworthy"
|
64
|
+
- "exploit\\w*"
|
65
|
+
- "blackhat"
|
66
|
+
- "gray hat"
|
67
|
+
- "dump analysis"
|
68
|
+
- "threat[s]*"
|
69
|
+
- "antivirus"
|
70
|
+
- "backtrack"
|
71
|
+
- "obfuscation"
|
72
|
+
- "devopssec"
|
73
|
+
- "hack\\w*"
|
74
|
+
- "memory analysis"
|
75
|
+
- "openvpn"
|
76
|
+
- "rootkit[s]*"
|
77
|
+
- "intrusion[s]*"
|
78
|
+
- "pentest\\w*"
|
79
|
+
- "fuzz\\w*"
|
80
|
+
- "burp"
|
81
|
+
- "red team"
|
82
|
+
- "blue team"
|
83
|
+
- "ghidra"
|
84
|
+
- "binary analysis"
|
85
|
+
- "radare2\\w*"
|
86
|
+
- "cybersecurity"
|
87
|
+
- "isc 2"
|
88
|
+
- "zero touch"
|
89
|
+
- "zseano"
|
86
90
|
- :outdir: "Security/Metasploit"
|
87
91
|
:matcher:
|
88
92
|
- "metasploit"
|
@@ -122,6 +126,7 @@
|
|
122
126
|
- "swt"
|
123
127
|
- "jfx"
|
124
128
|
- "javafx"
|
129
|
+
- "jvm"
|
125
130
|
- :outdir: "Java/Android"
|
126
131
|
:matcher:
|
127
132
|
- "android"
|
@@ -136,28 +141,29 @@
|
|
136
141
|
- :outdir: "Software Engineering"
|
137
142
|
:matcher:
|
138
143
|
- "domain driven"
|
139
|
-
- "test driven"
|
140
144
|
- "tdd"
|
141
145
|
- "bdd"
|
142
146
|
- "software testing"
|
143
147
|
- "continuous delivery"
|
144
148
|
- "event processing"
|
145
|
-
- "devops"
|
146
149
|
- "software estimation"
|
147
|
-
- "software by
|
150
|
+
- "software by numbers"
|
148
151
|
- "software technology"
|
149
152
|
- "programming architecture"
|
150
153
|
- "iterative software development"
|
154
|
+
- "devops"
|
155
|
+
- "devopssec"
|
156
|
+
- "software craftsmanship"
|
151
157
|
- :outdir: "Software Engineering/Testing"
|
152
158
|
:matcher:
|
153
|
-
- "
|
159
|
+
- "test\\w*"
|
154
160
|
- :outdir: "Software Engineering/Clean"
|
155
161
|
:matcher:
|
156
162
|
- "clean"
|
157
163
|
- :outdir: "Software Engineering/Design Pattern"
|
158
164
|
:matcher:
|
159
|
-
- "design pattern*"
|
160
|
-
- "pattern*"
|
165
|
+
- "design pattern[s]*"
|
166
|
+
- "pattern[s]*"
|
161
167
|
- :outdir: "Software Engineering Tools"
|
162
168
|
:matcher:
|
163
169
|
- "git"
|
@@ -167,29 +173,35 @@
|
|
167
173
|
- "cassandra"
|
168
174
|
- "entity framework"
|
169
175
|
- "hadoop"
|
170
|
-
- "test automation"
|
171
176
|
- "jenkin"
|
172
177
|
- "jmeter"
|
173
178
|
- "gradle"
|
174
179
|
- "apache"
|
175
180
|
- "libvirt"
|
176
181
|
- "telegram"
|
182
|
+
- :outdir: "CI_CD"
|
183
|
+
:matcher:
|
184
|
+
- "continuous integration"
|
185
|
+
- "jenkins"
|
186
|
+
- "ci"
|
187
|
+
- "cd"
|
188
|
+
- "circleci"
|
177
189
|
- :outdir: "Database"
|
178
190
|
:matcher:
|
179
191
|
- "graph databases"
|
180
192
|
- :outdir: "Database/PostgreSQL"
|
181
193
|
:matcher:
|
182
|
-
- "postgres*"
|
194
|
+
- "postgres\\w*"
|
183
195
|
- :outdir: "Raspberry-Pi"
|
184
196
|
:matcher:
|
185
|
-
- "raspberry*"
|
197
|
+
- "raspberry\\w*"
|
186
198
|
- :outdir: "Mobile Dev"
|
187
199
|
:matcher:
|
188
200
|
- "mobile"
|
189
201
|
- "hybrid"
|
190
202
|
- :outdir: "Python"
|
191
203
|
:matcher:
|
192
|
-
- "python"
|
204
|
+
- "\\w*python"
|
193
205
|
- :outdir: "Windows"
|
194
206
|
:matcher:
|
195
207
|
- "windows"
|
@@ -204,18 +216,20 @@
|
|
204
216
|
- "bash"
|
205
217
|
- :outdir: "_nix/bsd"
|
206
218
|
:matcher:
|
207
|
-
- "bsd"
|
219
|
+
- "\\w*bsd"
|
208
220
|
- :outdir: "Others/OpenCV"
|
209
221
|
:matcher:
|
210
222
|
- "opencv"
|
223
|
+
- "computer vision"
|
211
224
|
- :outdir: "Others/Tensorflow"
|
212
225
|
:matcher:
|
213
226
|
- "tensorflow"
|
214
227
|
- :outdir: "Others/IPV6"
|
215
228
|
:matcher:
|
216
229
|
- "ipv6"
|
217
|
-
- :outdir: "Others/
|
230
|
+
- :outdir: "Others/latex"
|
218
231
|
:matcher:
|
232
|
+
- "latex"
|
219
233
|
- "tex"
|
220
234
|
- :outdir: "Lisp Scheme Family"
|
221
235
|
:matcher:
|
@@ -253,14 +267,14 @@
|
|
253
267
|
- :outdir: "Algo"
|
254
268
|
:matcher:
|
255
269
|
- "art of computer programming"
|
256
|
-
- "algo*"
|
270
|
+
- "algo\\w*"
|
257
271
|
- "bayesian"
|
258
272
|
- :outdir: "Elixir-Erlang"
|
259
273
|
:matcher:
|
260
274
|
- "erlang"
|
261
275
|
- "elixir"
|
262
276
|
- "phoenix"
|
263
|
-
- "gen
|
277
|
+
- "gen server"
|
264
278
|
- :outdir: "Flutter-Dart"
|
265
279
|
:matcher:
|
266
280
|
- "flutter"
|
@@ -277,51 +291,52 @@
|
|
277
291
|
- "lua"
|
278
292
|
- :outdir: "Rust"
|
279
293
|
:matcher:
|
280
|
-
- "rust*"
|
294
|
+
- "rust\\w*"
|
281
295
|
- :outdir: "Go"
|
282
296
|
:matcher:
|
283
|
-
- "go
|
297
|
+
- "go"
|
284
298
|
- "golang"
|
285
299
|
- :outdir: "Mac iOS"
|
286
300
|
:matcher:
|
287
301
|
- "swift"
|
288
|
-
-
|
289
|
-
-
|
290
|
-
-
|
291
|
-
-
|
292
|
-
-
|
293
|
-
-
|
302
|
+
- "ios"
|
303
|
+
- "iphone"
|
304
|
+
- "ipad"
|
305
|
+
- "objective-c"
|
306
|
+
- "apple"
|
307
|
+
- "xcode"
|
308
|
+
- "mac os"
|
294
309
|
- :outdir: "C Assembly Compiler OS"
|
295
310
|
:matcher:
|
296
311
|
- "intel"
|
297
|
-
-
|
298
|
-
|
299
|
-
-
|
300
|
-
-
|
301
|
-
-
|
302
|
-
-
|
303
|
-
-
|
304
|
-
-
|
305
|
-
-
|
306
|
-
-
|
307
|
-
-
|
308
|
-
-
|
309
|
-
-
|
310
|
-
-
|
312
|
+
- "c"
|
313
|
+
- "assembly"
|
314
|
+
- "opcode"
|
315
|
+
- "ooc"
|
316
|
+
- "gcc"
|
317
|
+
- "c20"
|
318
|
+
- "cuda"
|
319
|
+
- "pointer[s]*"
|
320
|
+
- "compiler[s]*"
|
321
|
+
- "operating system[s]*"
|
322
|
+
- "pthread[s]*"
|
323
|
+
- "c\\+\\+"
|
324
|
+
- "antlr"
|
325
|
+
- "cpp"
|
311
326
|
- :outdir: "MicroService RESTFUL WebService"
|
312
327
|
:matcher:
|
313
|
-
- "web service*"
|
314
|
-
- "rest*"
|
315
|
-
- "microservice*"
|
328
|
+
- "web service[s]*"
|
329
|
+
- "rest\\w*"
|
330
|
+
- "microservice[s]*"
|
316
331
|
- :outdir: "Game-3D"
|
317
332
|
:matcher:
|
318
333
|
- "unity"
|
319
334
|
- "webgl"
|
320
335
|
- "opengl"
|
321
336
|
- "blender"
|
322
|
-
- "3d"
|
337
|
+
- "\\w*3d"
|
323
338
|
- "unreal"
|
324
|
-
- "game"
|
339
|
+
- "game[s]*"
|
325
340
|
- "vulkan"
|
326
341
|
:sub_dir_spec:
|
327
342
|
- :outdir: "Android"
|
@@ -348,10 +363,10 @@
|
|
348
363
|
- "opengl"
|
349
364
|
- :outdir: "Ruby-Rails"
|
350
365
|
:matcher:
|
351
|
-
- "ruby*"
|
352
|
-
-
|
353
|
-
-
|
354
|
-
-
|
355
|
-
-
|
356
|
-
-
|
357
|
-
-
|
366
|
+
- "\\w*ruby\\w*"
|
367
|
+
- "\\w*rails"
|
368
|
+
- "rspec"
|
369
|
+
- "rake"
|
370
|
+
- "sinatra"
|
371
|
+
- "nokogiri"
|
372
|
+
- "merb"
|
data/regex_test.rb
CHANGED
@@ -1,37 +1,56 @@
|
|
1
1
|
|
2
2
|
t = []
|
3
|
-
t << "art-of-computer-programming-"
|
4
|
-
t << "the-art-of-programming"
|
5
|
-
t << "the.art.of.programming"
|
6
|
-
t << "the_art_of_programming"
|
7
|
-
t << "art.of.taling"
|
8
|
-
t << "whatever there"
|
9
|
-
t << "art of whatever"
|
10
|
-
t << "tart.is.delicious"
|
11
|
-
t << "the-art.of-sing"
|
12
|
-
t << "nothing here"
|
13
|
-
t << " art-anter"
|
14
|
-
t << "Bug Bounty Playbook"
|
15
|
-
t << "the art"
|
16
|
-
t << "this is (art) of bounty"
|
17
|
-
|
3
|
+
#t << "art-of-computer-programming-"
|
4
|
+
#t << "the-art-of-programming"
|
5
|
+
#t << "the.art.of.programming"
|
6
|
+
#t << "the_art_of_programming"
|
7
|
+
#t << "art.of.taling"
|
8
|
+
#t << "whatever there"
|
9
|
+
#t << "art of whatever"
|
10
|
+
#t << "tart.is.delicious"
|
11
|
+
#t << "the-art.of-sing"
|
12
|
+
#t << "nothing here"
|
13
|
+
#t << " art-anter"
|
14
|
+
#t << "Bug Bounty Playbook"
|
15
|
+
#t << "the art"
|
16
|
+
#t << "this is (art) of bounty"
|
17
|
+
|
18
|
+
# test beginning
|
18
19
|
t << "r-cookbook-oreilly-cookbooks"
|
19
|
-
t << "
|
20
|
-
t << "
|
20
|
+
t << "r.dotbook"
|
21
|
+
t << "R.dotbook"
|
22
|
+
t << "r space"
|
23
|
+
# test middle
|
24
|
+
t << "using-r-for-data-analysis-in-social-sciences"
|
25
|
+
t << "using.r.for.data.analysis.in.social.sciences"
|
26
|
+
t << "using r for data analysis in social sciences"
|
27
|
+
t << "protein is doomed"
|
28
|
+
t << "protein-is-doomed"
|
29
|
+
t << "protein.is.doomed"
|
30
|
+
t << "ginger sings"
|
31
|
+
t << "ginger-sings"
|
32
|
+
t << "ginger.sings"
|
33
|
+
t << "the-earth-is-round"
|
34
|
+
# test end
|
35
|
+
t << "a-data-scientists-guide-to-acquiring-cleaning-and-managing-data-in-r"
|
21
36
|
|
22
37
|
name = "r"
|
23
|
-
|
24
|
-
v =~ /#{name}[-,.,_,\s]/ or
|
25
|
-
v =~ /[-,.,_,\s]#{name}[-,.,_,\s]/
|
26
|
-
v =~ /[-,.,_,\s]#{name}\z/
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
#v =~ /[-,.,_,\s]program\w+[-,.,_,\s]/ or
|
31
|
-
#v =~ /program\w+[-,.,_,\s]/ or
|
32
|
-
#v =~ /[-,.,_,\s]program\w+/
|
33
|
-
#v =~ /[-,.,_,\s]bounty\w*[-,.,_,\s]/i
|
34
|
-
#v =~ /[-,.,_,\s]art\z/
|
35
|
-
#v =~ /^art[-,.,_,\s]/
|
38
|
+
lead = t.select { |v|
|
39
|
+
#v =~ /#{name}[-,.,_,\s]/ or
|
40
|
+
#v =~ /[-,.,_,\s,^]#{name}[-,.,_,\s]/ or
|
41
|
+
#v =~ /[-,.,_,\s]#{name}\z/
|
42
|
+
|
43
|
+
v =~ /^#{name}[-,.,_,\s]/i
|
44
|
+
|
36
45
|
}
|
46
|
+
puts "lead length : #{lead.length}"
|
47
|
+
|
48
|
+
p res1
|
49
|
+
|
50
|
+
#res2 = t.select do |v|
|
51
|
+
# v =~ /[-,.,_,\s]#{name}[-,.,_,\s,\z]/i
|
52
|
+
#end
|
53
|
+
#puts "res2 length : #{res2.length}"
|
54
|
+
#p res2
|
55
|
+
|
37
56
|
|