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 +4 -4
- data/lib/name_gender_classifier.rb +3 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10d38c29130bda1c7b797836260491d3f097304569763a8829df2fb5cef0e279
|
4
|
+
data.tar.gz: 71733c3f4035dae89efb7d652330962e163a222a99dfb8d23381be0ab982537f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
20
|
-
when String, Symbol
|
19
|
+
if arg.is_a?(String) || arg.is_a?(Symbol)
|
21
20
|
most_probable_gender(arg)
|
22
|
-
|
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.
|
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-
|
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:
|
42
|
-
|
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: []
|