【文件属性】:
文件名称:gender-detector:从 PHP 中的名字获取性别
文件大小:380KB
文件格式:ZIP
更新时间:2021-05-31 10:35:40
gender-recognition name gender-from-name gender-detection PHP
性别检测器
GenderDetector 是一个 PHP 包,它根据名字检测一个人的性别。 它使用 Jörg Michael 的项目“gender.c”中的数据文件( )。
安装
用 Composer 安装
composer require tuqqu/gender-detector
用法
它的用法很简单,对于任何给定的名称,它都会为您提供以下性别(字符串)之一:
male
mostly_male
unisex
mostly_female
female
对于未知名称,它将返回null 。 为方便起见,所有性别值都可用作GenderDetector\Gender类的常量。
<?php
$ genderDetector = new GenderDetector \ GenderDetector ();
print $ genderDetector -> detect ( 'Thomas
【文件预览】:
gender-detector-master
----composer.json(1KB)
----.php_cs.dist(756B)
----bin()
--------gender-detector(2KB)
----data()
--------nam_dict.txt(4.15MB)
----tests()
--------GenderDetectorTest.php(2KB)
--------File()
--------fixtures()
----LICENSE(1KB)
----src()
--------GenderDetector.php(3KB)
--------Gender.php(283B)
--------File()
--------Country.php(4KB)
--------Exception()
----psalm.xml(519B)
----doc()
--------country_list.md(1KB)
----.gitignore(66B)
----phpunit.xml.dist(753B)
----README.md(3KB)