namegender 0.6.0 → 0.7.0
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/README.md +29 -0
- data/lib/namegender.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 658d4fb7a91170b0e2b2c61f23f172b259192bca6308113674e874057aa0adc1
|
|
4
|
+
data.tar.gz: a1272df8391d88b717b26494bf79bc16bbbc4c51a3db6bec6016177d8572828c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c83e850168ffcdfdd3ad530f59df0cb3db34dbf6a7159e6bc9bdd230156bbb2343192b79701d42a1f2420c0bff379b9cf7c84cba7436a5bec2ffc532c1c14876
|
|
7
|
+
data.tar.gz: bb93bcc96d6651dd39e0bfe25a0c4464db382e5c310f3879160f8c747a468840b2e8cd8f7b60da17ea0e93d411e02f70da2b2be72a7160111595eba614ecfe2d
|
data/README.md
CHANGED
|
@@ -84,6 +84,35 @@ does not apply here. If you already know the gender, pass
|
|
|
84
84
|
names and returns `results` in input order. An unsupported language raises
|
|
85
85
|
`NameGender::Error` with status 422 and `body["supported"]`.
|
|
86
86
|
|
|
87
|
+
## Name check
|
|
88
|
+
|
|
89
|
+
Whether a name typed into a form looks like a real person's name, with the
|
|
90
|
+
reasons. It never calls a name fake: use it to flag records for a closer look,
|
|
91
|
+
not to reject people automatically.
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
result = client.name_check("asdf qwerty")
|
|
95
|
+
puts result["assessment"] # implausible
|
|
96
|
+
puts result["score"] # 0 (0-100)
|
|
97
|
+
result["signals"].each { |s| puts "#{s["code"]} #{s["severity"]} #{s["part"]}" } # keyboard_pattern high first_name, ...
|
|
98
|
+
|
|
99
|
+
client.name_check("Jennifer Null")["assessment"] # plausible
|
|
100
|
+
|
|
101
|
+
# Names stored in separate fields are used as they are, not parsed:
|
|
102
|
+
client.name_check(first_name: "Jennifer", last_name: "Null", country: "US")
|
|
103
|
+
|
|
104
|
+
result = client.name_check_bulk(["Jennifer Null", "asdf qwerty"])
|
|
105
|
+
puts result["summary"] # total, plausible, suspicious, implausible
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
One credit per name. `assessment` is `"plausible"`, `"suspicious"` or
|
|
109
|
+
`"implausible"`; each signal has `code`, `severity` (`high`, `medium`, `low`,
|
|
110
|
+
`info`, `positive`), `part` and `value` (either can be `nil`). `evidence`
|
|
111
|
+
says whether the first name is counted, attested or not found. Surnames are
|
|
112
|
+
judged by their shape only. It takes `country:`, `locale:` and `ip:`, not
|
|
113
|
+
`best_guess` or `ai_fallback`. `name_check_bulk` takes up to 100 names and
|
|
114
|
+
returns `results` in input order.
|
|
115
|
+
|
|
87
116
|
## File jobs
|
|
88
117
|
|
|
89
118
|
Upload a CSV or XLSX file (up to 100 MB and 1,000,000 rows) and get it back
|
data/lib/namegender.rb
CHANGED
|
@@ -80,6 +80,27 @@ module NameGender
|
|
|
80
80
|
min_probability: min_probability, title: title
|
|
81
81
|
}.compact)
|
|
82
82
|
end
|
|
83
|
+
# Whether a name typed into a form looks like a real person's name, with
|
|
84
|
+
# reasons. It never calls a name fake: use it to flag records for a look,
|
|
85
|
+
# not to reject people automatically. "assessment" is "plausible",
|
|
86
|
+
# "suspicious" or "implausible", "score" is 0-100, and "signals" lists
|
|
87
|
+
# why ({"code", "severity", "part", "value"}; "part" and "value" can be
|
|
88
|
+
# nil). Surnames are judged by their shape only. `value` is the full name;
|
|
89
|
+
# pass `first_name:` and `last_name:` instead when they are stored
|
|
90
|
+
# separately (they are not parsed). `country`, `locale` and `ip` work as
|
|
91
|
+
# in #name. One credit per name. `best_guess`, `ai_fallback` and
|
|
92
|
+
# `language` do not apply here and are not accepted.
|
|
93
|
+
def name_check(value = nil, first_name: nil, last_name: nil, country: nil, locale: nil, ip: nil)
|
|
94
|
+
post("/name-check", {
|
|
95
|
+
name: value, first_name: first_name, last_name: last_name, country: country, locale: locale, ip: ip
|
|
96
|
+
}.compact)
|
|
97
|
+
end
|
|
98
|
+
# Up to 100 names; every option applies to all of them. "results" keeps
|
|
99
|
+
# the input order, "summary" counts the plausible, suspicious and
|
|
100
|
+
# implausible names.
|
|
101
|
+
def name_check_bulk(values, country: nil, locale: nil, ip: nil)
|
|
102
|
+
post("/name-check/bulk", { names: Array(values), country: country, locale: locale, ip: ip }.compact)
|
|
103
|
+
end
|
|
83
104
|
def account
|
|
84
105
|
request(Net::HTTP::Get, "/me")
|
|
85
106
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: namegender
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NameGender
|
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
|
11
11
|
date: 2026-10-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A dependency-free Ruby client for name, email, username, bulk, country
|
|
14
|
-
distribution and
|
|
14
|
+
distribution, salutation and name check lookups through NameGender.
|
|
15
15
|
email:
|
|
16
16
|
- support@namegender.com
|
|
17
17
|
executables: []
|