| Recommend this page to a friend! |
| Info | Documentation | Reputation | Support forum | Blog | Links |
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 171 | All time: 8,838 This week: 51 | ||||
| Version | License | PHP version | Categories | |||
| gender-universal 1.0.3 | Custom (specified... | 5 | Localization, PHP 5, Text processing, L..., A... |
| Description | Author | |
This class can detect person gender name in multiple languages. |
Detects gender from person's name, capable to analyse strings in these scripts: Latin, Cyrillic, Hanzi (Kanji).
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
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Lic. | License text | |||
| Doc. | Documentation | |||
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% |
|
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.