name_gender_classifier 0.0.1 → 0.0.3

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: 787939c630e3a02792909f4e987711b5ce2e336b515db92f349bed2ebe696309
4
- data.tar.gz: 1ad33afd9ce5b28cdb1737345b7ba4d4b104b58fd0a85aa69d88cea2339f4403
3
+ metadata.gz: 10d38c29130bda1c7b797836260491d3f097304569763a8829df2fb5cef0e279
4
+ data.tar.gz: 71733c3f4035dae89efb7d652330962e163a222a99dfb8d23381be0ab982537f
5
5
  SHA512:
6
- metadata.gz: 54975df68d17a91d44292eac77e6ab4372c64f922ccd9ade1a2dee3ebe9b1a967f3a992d42b5b6367218a5cddbfce1559630b7013607b9189e377b46bc082afa
7
- data.tar.gz: 52f02d8ae418868dc3f529cf5eaa357470192fb1b549bf8602797576268d7128e60fb99eafc61abc0c163e8b58ba7b87f925875048b517ae3675e3e9bec7af97
6
+ metadata.gz: d08f27481609c79da29f73d93f00cb822e815d265481ef421b3d354b058fbcebb6994f802f34f5f4bd89f4d41d17c80eaa29c943cbe88e2d21ea409d6bd72d59
7
+ data.tar.gz: 1cbcb55874c2829aa30c11de4d34fc31af86e13f55eec1231d358e1dccdfa7e3a8f0c4a4cd4c36911e37c1a456a71120ce611190e3c0238dfaa52db6b9ff2d7d
@@ -16,10 +16,9 @@ module NameGenderClassifier
16
16
  #
17
17
  # @return [String, Array<String>, Array<Object>] the gender classification for the passed first names
18
18
  def self.classify(arg, options = {})
19
- case arg
20
- when String, Symbol
19
+ if arg.is_a?(String) || arg.is_a?(Symbol)
21
20
  most_probable_gender(arg)
22
- when Array
21
+ elsif arg.respond_to?(:[]) && arg.respond_to?(:each)
23
22
  # Assumes that all elements within the array are of the same type as the first.
24
23
  if arg[0].is_a?(String) || arg[0].is_a?(Symbol)
25
24
  classify_array(arg)
@@ -38,7 +37,7 @@ module NameGenderClassifier
38
37
  result = []
39
38
  DatabaseManager.gdbm do |db|
40
39
  array.each do |name|
41
- next unless name
40
+ result << nil && next unless name
42
41
 
43
42
  result << most_probable_gender(name, db)
44
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: name_gender_classifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avantsoft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gdbm
@@ -38,8 +38,8 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
- description: Using primarily IBGE census data [2010], this gem classifies brazilian
42
- first names as 'male' or 'female'.
41
+ description: The name_gender_classifier gem classifies Brazilian first names as either
42
+ 'male' or 'female' based on the 2010 IBGE census.
43
43
  email: hello@avantsoft.com.br
44
44
  executables: []
45
45
  extensions: []