PHP Classes

Gender Universal: Detect person gender name in multiple languages

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 168 This week: 1All time: 8,862 This week: 560Up
Version License PHP version Categories
gender-universal 1.0.3Custom (specified...5Localization, PHP 5, Text processing, L..., A...
Description 

Author

This class can detect person gender name in multiple languages.

It takes the name of a person and an optional country identifier and detect the gender of the person.

This class uses other classes that are specialized in detecting the gender of people in certain limiyLatin, Cyrillic, Hanzi (Kanji).

Picture of Peter Kahl
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 37 packages by
Country: United Kingdom
Age: ???
All time rank: 41721 in United Kingdom
Week rank: 52 Up4 in United Kingdom Up
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Documentation

Gender Universal

Detects gender from person's name, capable to analyse strings in these scripts: Latin, Cyrillic, Hanzi (Kanji).

Dependencies

Usage

use peterkahl\GenderUniversal\GenderUniversal;

$gendObj = new GenderUniversal;

#-------------------------------
# French (Latin) name
$gendObj->firstName = 'Gaétan';
$gendObj->lastName  = '';         # Surname is irrelevant (in this case)
$gendObj->country   = 'FR';       # Country code may be helpful

echo $gendObj->getGender(); # M

#-------------------------------
# Russian (Cyrillic) name
$gendObj->firstName = '????';
$gendObj->lastName  = '????????'; # Surname may be helpful
$gendObj->country   = '';

echo $gendObj->getGender(); # F

#-------------------------------
# Chinese (Hanzi) name
$gendObj->firstName = '??';      # Make sure this is only given name (not surname)
$gendObj->lastName  = '';         # Surname is irrelevant (in this case)
$gendObj->country   = '';         # Country code is irrelevant (in this case)

echo $gendObj->getGender(); # M

#-------------------------------
# Japanese (Kanji) name
$gendObj->firstName = '??';      # Make sure this is only given name (not surname)
$gendObj->lastName  = '';         # Surname is irrelevant (in this case)
$gendObj->country   = '';         # Country code is irrelevant (in this case)

echo $gendObj->getGender(); # M

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file GenderUniversal.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:168
This week:1
All time:8,862
This week:560Up