Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| GrammarKk | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| process | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | |
| 7 | namespace Wikimedia\Leximorph\Handler\Overrides\Grammar; |
| 8 | |
| 9 | use Wikimedia\Leximorph\Handler\Overrides\IGrammarTransformer; |
| 10 | |
| 11 | /** |
| 12 | * GrammarKk |
| 13 | * |
| 14 | * Implements grammar transformations for Kazakh (kk). |
| 15 | * Delegates processing to the Cyrillic-based implementation. |
| 16 | * |
| 17 | * These rules don't cover the whole grammar of the language. |
| 18 | * This logic was originally taken from MediaWiki Core. |
| 19 | * Thanks to all contributors. |
| 20 | * |
| 21 | * @since 1.45 |
| 22 | * @author Doğu Abaris (abaris@null.net) |
| 23 | * @license https://www.gnu.org/copyleft/gpl.html GPL-2.0-or-later |
| 24 | */ |
| 25 | class GrammarKk implements IGrammarTransformer { |
| 26 | /** |
| 27 | * Applies Kazakh-specific grammatical transformations. |
| 28 | * |
| 29 | * @param string $word The word to process. |
| 30 | * @param string $case The grammatical case. |
| 31 | * |
| 32 | * @since 1.45 |
| 33 | * @return string The processed word. |
| 34 | */ |
| 35 | public function process( string $word, string $case ): string { |
| 36 | // T277689: If there's no word, then there's nothing to convert. |
| 37 | if ( $word === '' ) { |
| 38 | return ''; |
| 39 | } |
| 40 | |
| 41 | return ( new GrammarKk_cyrl() )->process( $word, $case ); |
| 42 | } |
| 43 | } |