email_signature_parser 0.1.1 → 0.1.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: 276004e620bb311863f8af53b6247b3d65160242e78e1eedde1cb4dba302cc1b
4
- data.tar.gz: b92b2222b0b64f97c67f19ecd6a4026cf93e622c7a685d8ba61090b0ecc0391f
3
+ metadata.gz: 6008ad813f969cfb3b8b8b8c2dec4d99e2c083c75aa2a119130619f11d4ff63e
4
+ data.tar.gz: 9af9028a049eacc2c58b665764fd422e1da98aec84a6ea7cec1b9138ac43abb7
5
5
  SHA512:
6
- metadata.gz: 6bab1405757b03908ffd6a973f45c24689c0b6eebf5b9f832c0d2bda35dfa7dde9bf6c46e7e4dbf50b8060baf00d91e15a031499d4ac1a429883ab567e9fdf4a
7
- data.tar.gz: 840e2be844581a467912f5af19b99035f87dd0932dd652f89d0215ee71af342c81193e22eef505a4d6d18e4b00f9f0acffeee4bd5f44f2c40185974b7a325b8a
6
+ metadata.gz: 594f404dacc0c455a2bf1abe13647789e3207ba9bd3f515a7b2b511a5e64d97a88b24a55e9f60d53d810b839e77ac70b00a898bada86ded1d723c04b0b70ecb8
7
+ data.tar.gz: 51942c0490ab2f46a21226f676b23830c2d6a97ba3dd0295490c71e485fd55fea60b5def06b3e1f08b80cbf52f9631a696c08eef1571d9b354aa3c4918e38035
@@ -96,10 +96,10 @@ module EmailSignatureParser
96
96
  @parsed_text << "\n-------------------------------------------------------------------------------------------------------------------------------------------------\n"
97
97
  end
98
98
 
99
- if (@current_element == :ol && name == :start)
99
+ if (@current_element == :ol && name == :start && !@lists.last.nil?)
100
100
  @lists.last[:ordered_list_level] = value.to_i
101
101
  end
102
- if (@current_element == :ol && name == :type)
102
+ if (@current_element == :ol && name == :type && !@lists.last.nil?)
103
103
  @lists.last[:ordered_list_type] = value
104
104
  end
105
105
  end
@@ -62,17 +62,16 @@ module EmailSignatureParser
62
62
  COMMON_COMPANY_ENDINGS = [
63
63
  # English suffixes
64
64
  'inc', 'incorporated', 'corp', 'corporation', 'company', 'co', 'ltd', 'limited',
65
- 'llc', 'lp', 'limited partnership', 'plc', 'public limited company',
65
+ 'llc', 'lp', 'partnership', 'plc', 'public',
66
66
  'enterprises', 'group', 'holdings', 'international', 'intl', 'worldwide',
67
67
  'global', 'associates', 'partners', 'consulting', 'services', 'solutions',
68
68
  'systems', 'technologies', 'tech', 'industries', 'manufacturing', 'mfg',
69
69
 
70
70
  # Spanish suffixes
71
- 'sa', 'sociedad anónima', 'sl', 'sociedad limitada', 'srl', 'sociedad de responsabilidad limitada',
72
- 'sc', 'sociedad colectiva', 'scp', 'sociedad civil particular', 'scpp', 'sociedad civil público privada',
73
- 'sad', 'sociedad anónima deportiva', 'sal', 'sociedad anónima laboral', 'sll', 'sociedad limitada laboral',
74
- 'sau', 'sociedad anónima unipersonal', 'slu', 'sociedad limitada unipersonal',
75
- 'sociedad', 'compañía', 'cia', 'empresa', 'corporación', 'grupo', 'holding',
71
+ 'sa', 'sociedad', 'anónima', 'sl', 'srl', 'responsabilidad', 'limitada',
72
+ 'sc', 'scp', 'colectiva', 'civil', 'particular', 'scpp', 'público', 'privada',
73
+ 'sad', 'deportiva', 'sal', 'laboral', 'sll',
74
+ 'sau', 'unipersonal', 'slu', 'compañía', 'cia', 'empresa', 'corporación', 'grupo', 'holding',
76
75
  'internacional', 'mundial', 'global', 'asociados', 'socios', 'consultoría',
77
76
  'servicios', 'soluciones', 'sistemas', 'tecnologías', 'industrias', 'industrial',
78
77
  'ltda', 'limitada',
@@ -625,20 +624,11 @@ module EmailSignatureParser
625
624
  end
626
625
  end
627
626
 
628
- job_title = {}
627
+ job_title = {
628
+ titles: parsed_titles,
629
+ acronyms: acronyms_found
630
+ }
629
631
 
630
- if acronyms_found.size == 1
631
- job_title[:acronym] = acronyms_found.first
632
- elsif acronyms_found.size > 1
633
- job_title[:acronyms] = acronyms_found
634
- end
635
-
636
- if parsed_titles.size == 1
637
- job_title[:title] = parsed_titles.first
638
- elsif parsed_titles.size > 1
639
- job_title[:titles] = parsed_titles
640
- end
641
-
642
632
  return [company_name.uniq.join(" "), job_title]
643
633
  end
644
634
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_signature_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Molini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-15 00:00:00.000000000 Z
11
+ date: 2025-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_postal