Socket
Socket
Sign inDemoInstall

gender-detection-from-name

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.1 to 1.5.0

.github/workflows/ci.yml

10

package.json
{
"name": "gender-detection-from-name",
"version": "1.4.1",
"version": "1.5.0",
"description": "Gender detection from first name",

@@ -27,10 +27,10 @@ "main": "index.js",

"devDependencies": {
"eslint": "^6.5.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"mocha": "^6.2.1"
"mocha": "^7.1.2"
}
}

@@ -1,3 +0,3 @@

# Gender detection from name
This simple project detects the gender of a first name. An optional language parameter can be specified to improve the detection, for example: Andrea in EN is female, in IT is male. If no language is specified, EN has priority.
# Gender detection from name [![Donate](https://img.shields.io/badge/paypal-donate-179BD7.svg)](https://www.paypal.me/dviolante)
Library to detect the gender of a first name. An optional language parameter can be specified to improve the detection, for example: Andrea in EN is female, in IT is male. If no language is specified, EN has priority.

@@ -11,10 +11,8 @@ ### Install

function main() {
const genderEN = getGender('Andrea', 'en')
const genderIT = getGender('Andrea', 'it')
const gender = getGender('Jennifer')
console.log(genderEN) // female
console.log(genderIT) // male
console.log(gender) // female
}
const genderEN = getGender('Andrea', 'en')
const genderIT = getGender('Andrea', 'it')
const gender = getGender('Jennifer')
console.log(genderEN) // female
console.log(genderIT) // male
console.log(gender) // female
```

@@ -27,1 +25,4 @@

- `npm run lint`
### Author
- [Davide Violante](https://github.com/DavideViolante/)

@@ -7,3 +7,3 @@ const assert = require('assert')

const names = ['Dave', 'John', 'Jacob', 'George', 'Lucas']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name, 'en'), 'male')

@@ -14,3 +14,3 @@ }

const names = ['Anna', 'Jennifer', 'Lisa', 'Susanne', 'Andrea']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name, 'en'), 'female')

@@ -21,3 +21,3 @@ }

const names = ['Davide', 'Federico', 'Giacomo', 'Giorgio', 'Andrea']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name, 'it'), 'male')

@@ -28,3 +28,3 @@ }

const names = ['Anna', 'Azzurra', 'Luisa', 'Marta', 'Caterina']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name, 'it'), 'female')

@@ -35,3 +35,3 @@ }

const names = ['Dave', 'John', 'Giacomo', 'George', 'Luca']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name, 'de'), 'male')

@@ -42,3 +42,3 @@ }

const names = ['Anna', 'Jennifer', 'Lisa', 'Marta', 'Catherine']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name, 'de'), 'female')

@@ -49,3 +49,3 @@ }

const names = ['Dave', 'John', 'Giacomo', 'George', 'Luca']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name), 'male')

@@ -56,3 +56,3 @@ }

const names = ['Anna', 'Jennifer', 'Lisa', 'Marta', 'Catherine']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name), 'female')

@@ -63,3 +63,3 @@ }

const names = ['Asdfgh', 'I do not exist', 'None']
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name), 'unknown')

@@ -70,3 +70,3 @@ }

const names = ['', undefined, null]
for (let name of names) {
for (const name of names) {
assert.strictEqual(getGender(name), 'unknown')

@@ -77,3 +77,3 @@ }

const langs = ['', undefined, null]
for (let lang of langs) {
for (const lang of langs) {
assert.strictEqual(getGender('Dave', lang), 'male')

@@ -80,0 +80,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc