Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed Feb 2, 2017
1 parent b6d8eed commit 403b5bc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Russian morphology:
```php
morphos\
Russian\
nameCase()
Cases
FirstNamesDeclension
LastNamesDeclension
Expand All @@ -67,17 +68,25 @@ morphos\

## Declension

### Names declension
To compound all declension functionality in one call there is `nameCase` function:

```php
string|array nameCase($name, $case = null, $gender = null)
```

Arguments:
- `$name` - full name as `Фамилия Имя` or `Фамилия Имя Отчество`.
- `$case` - can be `null` or one of `Cases` constants. If constant, a string will be returned. If null, an array will be returned.
- `$gender` - `NamesDeclension::MAN` or `NamesDeclension::WOMAN` or `null`.

### Declensions classes

All declension classes are similar and have three common methods:

- `boolean hasForms($word, $gender)` - Check if name is mutable.
- `string getForm($word, $case, $gender)` - Declines name.
- `array getForms($word, $gender)` - Declines name to all cases.

`Gender` is one value of:
- `NamesDeclension::MAN` or `m`
- `NamesDeclension::WOMAN` or `w`

`Case` is one constant of `Cases` class constants (described below).

#### First names (`FirstNamesDeclension`)
Expand Down

0 comments on commit 403b5bc

Please sign in to comment.