Skip to content

Commit 5918e92

Browse files
committed
Add description and instructions
1 parent 465ad6b commit 5918e92

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
11
# CapitalizePersonalNamesWithStringy
2-
A PHP library that helps you capitalize personal names
2+
A PHP library that helps you capitalize personal names. Extends [Stringy](https://github.com/danielstjules/Stringy), a PHP string manipulation library with multibyte support.
3+
4+
Personal names such as "Marcus Aurelius" are sometimes typed incorrectly using lowercase ("marcus aurelius").
5+
6+
Capitalizing "marcus aurelius" is a simple task. But some names are less simple. Consider "Zeno of Citium". If you have the string "zeno of citium", you should capitalize "zeno" and "citium", but not "of".
7+
8+
CapitalizePersonalNamesWithStringy helps you capitalize personal names by checking against a list of special cases that shouldn't be capitalized. If the name is in the list, it isn't capitalized.
9+
10+
11+
## Installation
12+
Add the following to your `composer.json`:
13+
14+
```json
15+
"require": {
16+
"yhoiseth/capitalize-personal-names-with-stringy": "~0.0.1"
17+
},
18+
"repositories": [
19+
{
20+
"type": "vcs",
21+
"url": "https://github.com/yhoiseth/CapitalizePersonalNamesWithStringy"
22+
}
23+
],
24+
```
25+
26+
## Usage
27+
```php
28+
<?php
29+
30+
use CapitalizePersonalNamesWithStringy\CapitalizePersonalNamesWithStringy as S;
31+
32+
$stringy = S::create('zeno of citium');
33+
34+
echo $stringy->capitalizePersonalName(); // 'Zeno of Citium'
35+
```

0 commit comments

Comments
 (0)