raicem/turkish-name-parser

解析和验证土耳其语姓名。

1.0.2 2017-04-27 15:07 UTC

This package is auto-updated.

Last update: 2024-09-18 06:22:47 UTC


README

这是一个简单的解析器,它解析土耳其语姓名并尝试验证它们。字符、标签和数字会被去除,剩下的内容将被评估。只有一个字母、没有元音的姓名被视为无效并被从结果中去除。解析器随后尝试对姓名进行排序,并确定姓氏、中间名和姓氏。

安装

php composer require raicem/turkish-name-parser

用法

use Raicem\NameParser;

$parser = new NameParser;
$name = $parser->parse('Ahmet Yılmaz');

// test weather the name was valid
$name->isValid();

// get the result as array
$name->asArray();

// get the result as string;
$name->asString();

// toString allows you to get the string as well
echo $name

// you can see whichs parts are invalid
$name->getInvalidChunks();