Skip to content

Commit

Permalink
Use Numeral instead of Number
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed Feb 3, 2017
1 parent 43817e6 commit b2ccef2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Tests & Quality: [![Build Status](https://travis-ci.org/wapmorgan/Morphos.svg)](
3. Last names
4. Nouns
2. Pluralization
3. Number creation
3. Numeral creation
4. Cases
4. English
1. Pluralization
Expand Down Expand Up @@ -72,7 +72,7 @@ morphos\
LastNamesDeclension
GeneralDeclension
Plurality
CardinalNumber
CardinalNumeral
```

## Declension
Expand Down Expand Up @@ -345,24 +345,24 @@ echo $count.' '.Plurality::pluralize($word, $count, false);
// result: 10 домов
```

## Number creation
## Numeral creation

All number creation classes are similar and have two common methods:

- `string getForm($number, $case)` - Get one form of a number.
- `array getForms($number)` - Get all forms of a number.

### Cardinal numbers (`CardinalNumber`)
### Cardinal numbers (`CardinalNumeral`)

_Creation of cardinal numerals in russian language._

Create declension class object:

```php
use morphos\Russian\CardinalNumber;
use morphos\Russian\CardinalNumeral;
use morphos\Russian\Cases;

$cardinal = new CardinalNumber();
$cardinal = new CardinalNumeral();
```

Get text representation of a number:
Expand Down
2 changes: 1 addition & 1 deletion src/NumberCreation.php → src/NumeralCreation.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace morphos;

class NumberCreation implements Cases {
class NumeralCreation implements Cases {
public function getForms($number) {}
public function getForm($number, $case) {}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
namespace morphos\Russian;

use morphos\NumberCreation;
use morphos\NumeralCreation;

/**
* Rules are from http://www.fio.ru/pravila/grammatika/sklonenie-imen-chislitelnykh/
*/
class CardinalNumber extends NumberCreation implements Cases {
class CardinalNumeral extends NumeralCreation implements Cases {
use RussianLanguage;

protected $words = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
require __DIR__.'/../../vendor/autoload.php';

use morphos\Russian\Cases;
use morphos\Russian\CardinalNumber;
use morphos\Russian\CardinalNumeral;

class CardinalNumberTest extends \PHPUnit_Framework_TestCase {
class CardinalNumeralTest extends \PHPUnit_Framework_TestCase {
protected $cardinal;

public function setUp() {
$this->cardinal = new CardinalNumber();
$this->cardinal = new CardinalNumeral();
}

/**
Expand Down

0 comments on commit b2ccef2

Please sign in to comment.