employ_me 0.0.4 → 0.0.6

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: 4346c4379f4120da39b6e2e0998de13d941ed0aa475ef86b94c27fcb551a736e
4
- data.tar.gz: 64a712333b97dbb6b782e443ad8ed64eb0cccaa2f1ccfc52900528194d20934c
3
+ metadata.gz: 1813eaad2894ab155c996fa0d4f367daff60858f2b9eecf63fd6d95b742ab4f4
4
+ data.tar.gz: a548d8c649421f6e56353ad9041c3745aec9c96d32b6b50c550aecff6a3754e6
5
5
  SHA512:
6
- metadata.gz: a825a154b544a483a34dacd641161ee8a253394c94c0083575f55d8cb6c9161ba6353fe7380e5f500b18b07d135cc5a2d9988029b402e35f19ba72295ba0b663
7
- data.tar.gz: 790b7854de9a3fbb3c643c16ab27eb7a07602f2e0499848967ef5a4fdf4f25ced68bcb5e1a7c1fc840c5b4baa032c672280db1a9ef8095556fbb74413bfe9a69
6
+ metadata.gz: 62d89c14f54be3eaab64d5431903b0a31512a347800b1c01245e3db4a0fb2755c8fbe5674acf5baa459c34a3e20f9c92ab76dd18c5d03eea9405337986ec981a
7
+ data.tar.gz: e87268900fc62ff2e5f29d7dc17e1b8c5a45fd9d45f56ef8b52807422c8c3679dbf20bda64d580d4b0204afa0a9526446c7dd5ae8dcfae4b2b5f1a4a6aab7b37
@@ -0,0 +1,76 @@
1
+ module EmployMe
2
+ module Parser
3
+ module Location
4
+ module Strategies
5
+ class PatternMatch
6
+ # Return [state code, city name, state 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
+ # Remote Jobs
18
+ regex = Regexp.new('US & Canada Remote', Regexp::IGNORECASE)
19
+ return ['REMOTE', nil, nil] if regex.match(curr_node_text)
20
+
21
+ # San Francisco, CA Jobs
22
+ regex = Regexp.new('San Francisco, CA', Regexp::IGNORECASE)
23
+ return ['CA', 'San Francisco', 'CA'] if regex.match(curr_node_text)
24
+
25
+ # San Mateo, CA Jobs
26
+ regex = Regexp.new('San Mateo, CA', Regexp::IGNORECASE)
27
+ return ['CA', 'San Mateo', 'CA'] if regex.match(curr_node_text)
28
+
29
+ # Boca Raton, FL Jobs
30
+ regex = Regexp.new('Boca Raton, FL', Regexp::IGNORECASE)
31
+ return ['FL', 'Boca Raton', 'FL'] if regex.match(curr_node_text)
32
+
33
+ regex = Regexp.new('Boca Raton, Florida', Regexp::IGNORECASE)
34
+ return ['FL', 'Boca Raton', 'FL'] if regex.match(curr_node_text)
35
+
36
+ regex = Regexp.new('Boca Raton, Florida, United States', Regexp::IGNORECASE)
37
+ return ['FL', 'Boca Raton', 'FL'] if regex.match(curr_node_text)
38
+
39
+ # Raleigh, NC Jobs
40
+ regex = Regexp.new('Raleigh, NC', Regexp::IGNORECASE)
41
+ return ['NC', 'Raleigh', 'NC'] if regex.match(curr_node_text)
42
+
43
+ # New York, NY Jobs
44
+ regex = Regexp.new('New York, NY', Regexp::IGNORECASE)
45
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
46
+
47
+ regex = Regexp.new('New York, New York', Regexp::IGNORECASE)
48
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
49
+
50
+ regex = Regexp.new('New York, New York, United States', Regexp::IGNORECASE)
51
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
52
+
53
+ regex = Regexp.new('New York Office', Regexp::IGNORECASE)
54
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
55
+
56
+ # Seattle, WA Jobs
57
+ regex = Regexp.new('Seattle, WA', Regexp::IGNORECASE)
58
+ return ['WA', 'Seattle', 'WA'] if regex.match(curr_node_text)
59
+
60
+ regex = Regexp.new('Seattle, Washington', Regexp::IGNORECASE)
61
+ return ['WA', 'Seattle', 'WA'] if regex.match(curr_node_text)
62
+
63
+ regex = Regexp.new('Seattle, Washington, United States', Regexp::IGNORECASE)
64
+ return ['WA', 'Seattle', 'WA'] if regex.match(curr_node_text)
65
+ end
66
+
67
+ tree.concat(curr_node.children)
68
+ end
69
+
70
+ nil
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ 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,2 +1,4 @@
1
+ require 'employ_me/parser/location/strategies/pattern_match.rb'
1
2
  require 'employ_me/parser/programming_language/strategies/pattern_match.rb'
3
+ require 'employ_me/parser/salary/strategies/pattern_match.rb'
2
4
  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.4
4
+ version: 0.0.6
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,7 +31,9 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - lib/employ_me.rb
34
+ - lib/employ_me/parser/location/strategies/pattern_match.rb
34
35
  - lib/employ_me/parser/programming_language/strategies/pattern_match.rb
36
+ - lib/employ_me/parser/salary/strategies/pattern_match.rb
35
37
  - lib/employ_me/parser/title/strategies/pattern_match.rb
36
38
  homepage: https://rubygems.org/gems/employ_me
37
39
  licenses: []