employ_me 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa8aec2d7684da0cb0826e4bd02214ef6cc86929684ee49339010be8c17de0d8
4
- data.tar.gz: 46e02aa779d33bb9f0132b6b745e9131dbb19ab8ce40d81f876f2bedd3bb5537
3
+ metadata.gz: 4641343462a07ca0992a2c75f56a2be04370270a7d9435fe6378dc603ee4dd78
4
+ data.tar.gz: 066163010a0e8b376aaaa07895dbcf05abf5bf97803bc35de20d6cbc8ba30047
5
5
  SHA512:
6
- metadata.gz: 77c9516178e6d827e29f194cbca9eaf5136056a6c83c1159409ec9a7e4e0b04f82b13b3d2a7ba9af59cf8a6067797088a62a0fecf386af1d0d7d69de2ccc1ec4
7
- data.tar.gz: b78a29f250bdac1a9cc02dd7df0dfec136d2616e57014bd2c8551e908fdcfabf64125119e823a733b12bd3a44c3646012375c928c6ccb8b9e708ad7cb4e67c25
6
+ metadata.gz: 5323cbbb70b4cad1dacfb0ed1618f1366f9be38378d3ee217eebc1c92a469edc71902c9eda12766cfcd0e9011d6383f957e55f9e539077de351322fdc3ea9cd1
7
+ data.tar.gz: 53c7a3f07676c99db497f77baeecb72212589844583677b1a8f1438f1dcebd72c328641a63eb39a85a41124db3d20e923b70488d5798b509db2f2f33b38f8bf8
@@ -0,0 +1,139 @@
1
+ module EmployMe
2
+ module Parser
3
+ module Title
4
+ module Strategies
5
+ class PatternMatch
6
+ # Return [title, seniority]
7
+ def self.perform(root_node)
8
+ tree = [root_node]
9
+
10
+ # Depth First Search
11
+ while tree.size > 0
12
+ curr_node = tree.shift
13
+
14
+ if curr_node.children.all? { |child| child.name == "comment" || child.name == 'text' }
15
+ curr_node_text = curr_node.text
16
+
17
+ # Title: Principal Machine Learning Engineer
18
+ regex = Regexp.new('Principal Machine Learning Engineer', Regexp::IGNORECASE)
19
+ result = regex.match(curr_node_text)
20
+
21
+ if result
22
+ return ['Principal Machine Learning Engineer', 'staff']
23
+ end
24
+
25
+ # Title: Staff Data Engineer
26
+ regex = Regexp.new('Staff Data Engineer', Regexp::IGNORECASE)
27
+ result = regex.match(curr_node_text)
28
+
29
+ if result
30
+ return ['Staff Data Engineer', 'staff']
31
+ end
32
+
33
+ # Title: Staff iOS Engineer
34
+ regex = Regexp.new('Staff iOS Engineer', Regexp::IGNORECASE)
35
+ result = regex.match(curr_node_text)
36
+
37
+ if result
38
+ return ['Staff iOS Engineer', 'staff']
39
+ end
40
+
41
+ # Title: Staff Software Engineer
42
+ regex = Regexp.new('Staff Software Engineer', Regexp::IGNORECASE)
43
+ result = regex.match(curr_node_text)
44
+
45
+ if result
46
+ return ['Staff Software Engineer', 'staff']
47
+ end
48
+
49
+ # Title: Senior Data Engineer
50
+ regex = Regexp.new('Senior Data Engineer', Regexp::IGNORECASE)
51
+ result = regex.match(curr_node_text)
52
+
53
+ if result
54
+ return ['Senior Data Engineer', 'senior']
55
+ end
56
+
57
+ # Title: Senior Frontend Engineer
58
+ regex = Regexp.new('Senior Frontend Engineer', Regexp::IGNORECASE)
59
+ result = regex.match(curr_node_text)
60
+
61
+ if result
62
+ return ['Senior Frontend Engineer', 'senior']
63
+ end
64
+
65
+ # Title: Senior Full Stack Engineer
66
+ regex = Regexp.new('Senior Full Stack Engineer', Regexp::IGNORECASE)
67
+ result = regex.match(curr_node_text)
68
+
69
+ if result
70
+ return ['Senior Full Stack Engineer', 'senior']
71
+ end
72
+
73
+ # Title: Senior iOS Engineer
74
+ regex = Regexp.new('Senior iOS Engineer', Regexp::IGNORECASE)
75
+ result = regex.match(curr_node_text)
76
+
77
+ if result
78
+ return ['Senior iOS Engineer', 'senior']
79
+ end
80
+
81
+ # Title: Senior Machine Learning Engineer
82
+ regex = Regexp.new('Senior Machine Learning Engineer', Regexp::IGNORECASE)
83
+ result = regex.match(curr_node_text)
84
+
85
+ if result
86
+ return ['Senior Machine Learning Engineer', 'senior']
87
+ end
88
+
89
+ # Title: Senior Security Engineer
90
+ regex = Regexp.new('Senior Security Engineer', Regexp::IGNORECASE)
91
+ result = regex.match(curr_node_text)
92
+
93
+ if result
94
+ return ['Senior Security Engineer', 'senior']
95
+ end
96
+
97
+ # Title: Senior Site Reliability Engineer
98
+ regex = Regexp.new('Senior Site Reliability Engineer', Regexp::IGNORECASE)
99
+ result = regex.match(curr_node_text)
100
+
101
+ if result
102
+ return ['Senior Site Reliability Engineer', 'senior']
103
+ end
104
+
105
+ # Title: Senior Software Engineer
106
+ regex = Regexp.new('Senior Software Engineer', Regexp::IGNORECASE)
107
+ result = regex.match(curr_node_text)
108
+
109
+ if result
110
+ return ['Senior Software Engineer', 'senior']
111
+ end
112
+
113
+ # Title: Front-End Software Engineer
114
+ regex = Regexp.new('Front-End Software Engineer', Regexp::IGNORECASE)
115
+ result = regex.match(curr_node_text)
116
+
117
+ if result
118
+ return ['Front-End Software Engineer', 'midlevel']
119
+ end
120
+
121
+ # Title: Software Engineer
122
+ regex = Regexp.new('Software Engineer', Regexp::IGNORECASE)
123
+ result = regex.match(curr_node_text)
124
+
125
+ if result
126
+ return ['Software Engineer', 'midlevel']
127
+ end
128
+ end
129
+
130
+ tree.concat(curr_node.children)
131
+ end
132
+
133
+ nil
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
data/lib/employ_me.rb CHANGED
@@ -1,2 +1 @@
1
- module EmployMe
2
- end
1
+ require 'employ_me/parser/title/strategies/pattern_match.rb'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: employ_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dgonzdev
@@ -17,6 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/employ_me.rb
20
+ - lib/employ_me/parser/title/strategies/pattern_match.rb
20
21
  homepage: https://rubygems.org/gems/employ_me
21
22
  licenses: []
22
23
  metadata: {}