-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,098 additions
and
1,208 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Contribution | ||
|
||
`Morphos` are open for additions and improvements. | ||
|
||
Addition a new language is simple: create the class inheriting one of basic classes and realize abstract methods from it. | ||
|
||
Here is a list of basic abstract classes: | ||
|
||
#### `morphos\NamesDeclensions` | ||
Class for names declension. | ||
|
||
* ```php | ||
abstract public function hasForms($name, $gender); | ||
``` | ||
Checks, whether there are rules for this name. | ||
|
||
* ```php | ||
abstract public function getForms($name, $gender); | ||
``` | ||
Generates all forms of a name. | ||
|
||
* ```php | ||
abstract public function getForm($name, $form, $gender); | ||
``` | ||
Generates one form of a name. | ||
|
||
#### `morphos\GeneralDeclension` | ||
|
||
* ```php | ||
public function hasForms($word, $animate = false); | ||
``` | ||
Checks, whether there are rules for this word. | ||
|
||
* ```php | ||
public function getForms($word, $animate = false); | ||
``` | ||
Generates all forms of a word. | ||
|
||
* ```php | ||
public function getForm($word, $form, $animate = false); | ||
``` | ||
Generates one form of a word. | ||
|
||
### Useful functions | ||
|
||
For simple access to string processing Morphos creates few functions in global namespace: | ||
|
||
1. `set_encoding()` - Sets encoding for using in morphos/* functions. | ||
2. `length()` - Calculates count of characters in string. | ||
3. `slice()` - Slices string like python. | ||
4. `lower()` - Lower case. | ||
5. `upper()` - Upper case. | ||
6. `name()` - Name case. (ex: Thomas Lewis) | ||
7. `chars_count()` - Count of few chars. | ||
8. `last_position_for_one_of_chars()` - Finds last position for one of chars. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?php | ||
namespace morphos; | ||
|
||
interface Cases { | ||
const NOMINATIVE = 'nominativus'; | ||
const GENETIVE = 'genetivus'; | ||
const DATIVE = 'dativus'; | ||
const ACCUSATIVE = 'accusative'; | ||
const ABLATIVE = 'ablativus'; | ||
const PREPOSITIONAL = 'praepositionalis'; | ||
} | ||
<?php | ||
namespace morphos; | ||
|
||
interface Cases { | ||
const NOMINATIVE = 'nominativus'; | ||
const GENETIVE = 'genetivus'; | ||
const DATIVE = 'dativus'; | ||
const ACCUSATIVE = 'accusative'; | ||
const ABLATIVE = 'ablativus'; | ||
const PREPOSITIONAL = 'praepositionalis'; | ||
} |
Oops, something went wrong.