employ_me 0.0.3 → 0.0.5

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: 52963be5fb74e070a29c3aeb6d904f0e0b986d047da024f55f71bb1aa117e573
4
- data.tar.gz: 944f282e9f6d7f16e4cdbfe20a57279246ded777062c4eba67cd176831ebc5ba
3
+ metadata.gz: bf37370d3f7bf02eb6cf13e67c6f5c075c1b1082eab6b068202eb057ab79c34f
4
+ data.tar.gz: e7d65db11f7260bc26c5fab9e6e2c00c284ec4336b2934171d4958213c19eebf
5
5
  SHA512:
6
- metadata.gz: dffadf657ac31e044db2e9e87949585857d32344042e5ffea5d0341495b1e057873ea77d2e993ac22a1a6f1ac8f9146920487d20dcc6676a092a39461d43d281
7
- data.tar.gz: 670e265d55220fdc5df5347edd838e194ecc29f0ff143507d70a1c3795999484dfa30871d3aeb160ceca9112a4107a4d7af1560a22ebc49762ba990341741a61
6
+ metadata.gz: 5ef8e85d23a7a12db2abce764bb26851fcf9ed5c8612790cf5ae37e40ddac4583e1fe603b4dfdbc0dd39d90d2f849339dba4c4ea18dcb123cd8383bf11033405
7
+ data.tar.gz: 0c1d0fe3a2748649144c75c24d71f5698b028be3bb3f1e35f70527c68af1256408a28698323b7f4663df74dd37033b80b96dc0e9c395f19f46b43efc0e240fe6
@@ -0,0 +1,61 @@
1
+ module EmployMe
2
+ module Parser
3
+ module ProgrammingLanguage
4
+ module Strategies
5
+ class PatternMatch
6
+ # Return [programming language name]
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
+ # C#
18
+ regex = Regexp.new('C#', Regexp::IGNORECASE)
19
+ return 'c_sharp' if regex.match(curr_node_text)
20
+
21
+ # Go
22
+ regex = Regexp.new('Go', Regexp::IGNORECASE)
23
+ return 'go' if regex.match(curr_node_text)
24
+
25
+ # Java
26
+ regex = Regexp.new('Java', Regexp::IGNORECASE)
27
+ return 'java' if regex.match(curr_node_text)
28
+
29
+ # Javascript
30
+ regex = Regexp.new('Node', Regexp::IGNORECASE)
31
+ return 'javascript' if regex.match(curr_node_text)
32
+
33
+ regex = Regexp.new('React', Regexp::IGNORECASE)
34
+ return 'javascript' if regex.match(curr_node_text)
35
+
36
+ regex = Regexp.new('Typescript', Regexp::IGNORECASE)
37
+ return 'javascript' if regex.match(curr_node_text)
38
+
39
+ # Kotlin
40
+ regex = Regexp.new('Kotlin', Regexp::IGNORECASE)
41
+ return 'kotlin' if regex.match(curr_node_text)
42
+
43
+ # Python
44
+ regex = Regexp.new('Python', Regexp::IGNORECASE)
45
+ return 'python' if regex.match(curr_node_text)
46
+
47
+ # Ruby
48
+ regex = Regexp.new('Ruby', Regexp::IGNORECASE)
49
+ return 'ruby' if regex.match(curr_node_text)
50
+ end
51
+
52
+ tree.concat(curr_node.children)
53
+ end
54
+
55
+ nil
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,71 @@
1
+ module EmployMe
2
+ module Parser
3
+ module Salary
4
+ module Strategies
5
+ class PatternMatch
6
+ # Return [salary floor, salary ceiling]
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
+ # Salary Format: $100K - $200K
18
+ regex = Regexp.new('\\$([0-9]+)K \S \\$([0-9]+)K', Regexp::IGNORECASE)
19
+ result = regex.match(curr_node_text)
20
+
21
+ if result
22
+ low = result[1].to_i * 1000
23
+ high = result[2].to_i * 1000
24
+
25
+ return [low, high]
26
+ end
27
+
28
+ # Salary Format: $100,000 - $200,000
29
+ regex = Regexp.new('\\$([0-9]+),[0-9]+ - \\$([0-9]+),[0-9]+', Regexp::IGNORECASE)
30
+ result = regex.match(curr_node_text)
31
+
32
+ if result
33
+ low = result[1].to_i * 1000
34
+ high = result[2].to_i * 1000
35
+
36
+ return [low, high]
37
+ end
38
+
39
+ # Salary Format: $100,000 to $200,000
40
+ regex = Regexp.new('\\$([0-9]+),[0-9]+ to \\$([0-9]+),[0-9]+', Regexp::IGNORECASE)
41
+ result = regex.match(curr_node_text)
42
+
43
+ if result
44
+ low = result[1].to_i * 1000
45
+ high = result[2].to_i * 1000
46
+
47
+ return [low, high]
48
+ end
49
+
50
+ # Salary Format: $100,000 - $200,000 USD
51
+ regex = Regexp.new('\\$([0-9]+),[0-9]+ - \\$([0-9]+),[0-9]+ USD', Regexp::IGNORECASE)
52
+ result = regex.match(curr_node_text)
53
+
54
+ if result
55
+ low = result[1].to_i * 1000
56
+ high = result[2].to_i * 1000
57
+
58
+ return [low, high]
59
+ end
60
+ end
61
+
62
+ tree.concat(curr_node.children)
63
+ end
64
+
65
+ nil
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
data/lib/employ_me.rb CHANGED
@@ -1 +1,3 @@
1
+ require 'employ_me/parser/programming_language/strategies/pattern_match.rb'
2
+ require 'employ_me/parser/salary/strategies/pattern_match.rb'
1
3
  require 'employ_me/parser/title/strategies/pattern_match.rb'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: employ_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - dgonzdev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-14 00:00:00.000000000 Z
11
+ date: 2025-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -31,6 +31,8 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - lib/employ_me.rb
34
+ - lib/employ_me/parser/programming_language/strategies/pattern_match.rb
35
+ - lib/employ_me/parser/salary/strategies/pattern_match.rb
34
36
  - lib/employ_me/parser/title/strategies/pattern_match.rb
35
37
  homepage: https://rubygems.org/gems/employ_me
36
38
  licenses: []