Skip to content

Commit

Permalink
Merge pull request #15 from theiconic/feature/update-readme
Browse files Browse the repository at this point in the history
Update readme with documentation for latest features
  • Loading branch information
wyrfel committed Aug 28, 2018
2 parents 17ce0ba + 51e52ea commit 725c5b4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[![Latest Stable Version](https://poser.pugx.org/theiconic/name-parser/v/stable?t=201705161308)](https://packagist.org/packages/theiconic/name-parser)
[![Total Downloads](https://poser.pugx.org/theiconic/name-parser/downloads?t=201705161308)](https://packagist.org/packages/theiconic/name-parser)
[![License](https://poser.pugx.org/theiconic/name-parser/license?t=201705161308)](https://packagist.org/packages/theiconic/name-parser)
[![Dependency Status](https://www.versioneye.com/user/projects/591a676ba593390051b42cdd/badge.svg?style=flat&t=201705161308)](https://www.versioneye.com/user/projects/591a676ba593390051b42cdd)

## Purpose
This is a universal, language-independent name parser.
Expand Down Expand Up @@ -89,6 +88,22 @@ echo $name; // re-prints the full normalised name
```
An empty string is returned for missing parts.

### Special part retrieval features
#### Explicit last name parts
You can retrieve last name prefixes and pure last names separately with
```php
echo $name->getLastnamePrefix();
echo $name->getLastname(true); // true enables strict mode for pure lastnames, only
```

#### Nick names with normalized wrapping
By default, `getNickname()` returns the pure string of nick names. However, you can
pass `true` to have the same normalised parenthesis wrapping applied as in `echo $name`:
```php
echo $name->getNickname(); // The Giant
echo $name->getNickname(true); // (The Giant)
```

### Setting Languages
```php
$parser = new TheIconic\NameParser\Parser([
Expand Down

0 comments on commit 725c5b4

Please sign in to comment.