The grammar rules for Ukrainian have several mistakes.
This is the first in a series of commits that fix this.
* Add grammar tests for PHP. There weren't any tests at all,
and now there are some. Not tests are added for rules that
are wrong and irrelevant and will be removed in subsequent commits.
* Add tests for JavaScript, and update a grammar rule that was
incorrectly copied from Russian.
Change-Id: I6de4581e2908eba39b33a13b07d048a34a3bd803
word = word.slice( 0, -2 ) + 'ки';
} else if ( word.slice( -2 ) === 'ти' ) {
word = word.slice( 0, -2 ) + 'тей';
- } else if ( word.slice( -2 ) === 'ды' ) {
- word = word.slice( 0, -2 ) + 'дов';
+ } else if ( word.slice( -2 ) === 'ди' ) {
+ word = word.slice( 0, -2 ) + 'дів';
} else if ( word.slice( -3 ) === 'ник' ) {
word = word.slice( 0, -3 ) + 'ника';
}
array( 'other', 121 ),
);
}
+
+ /**
+ * @dataProvider providerGrammar
+ * @covers Language::convertGrammar
+ */
+ public function testGrammar( $result, $word, $case ) {
+ $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+ }
+
+ public static function providerGrammar() {
+ return array(
+ array(
+ 'Вікіпедії',
+ 'Вікіпедія',
+ 'genitive',
+ ),
+ array(
+ 'Віківидів',
+ 'Віківиди',
+ 'genitive',
+ ),
+ array(
+ 'Вікіпедію',
+ 'Вікіпедія',
+ 'accusative',
+ ),
+ );
+ }
}
description: 'Grammar test for genitive case'
},
{
- word: 'доводÑ\8b',
+ word: 'Ð\92Ñ\96кÑ\96види',
grammarForm: 'genitive',
- expected: 'доводов',
+ expected: 'Ð\92Ñ\96кÑ\96видÑ\96в',
description: 'Grammar test for genitive case'
},
{