Code Duplication    Length = 28-31 lines in 3 locations

languages/classes/LanguageBs.php 1 location

@@ 29-59 (lines=31) @@
26
 *
27
 * @ingroup Language
28
 */
29
class LanguageBs extends Language {
30
	/**
31
	 * Convert from the nominative form of a noun to some other case
32
	 * Invoked with {{GRAMMAR:case|word}}
33
	 *
34
	 * Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ
35
	 *
36
	 * @param string $word
37
	 * @param string $case
38
	 *
39
	 * @return string
40
	 */
41
	function convertGrammar( $word, $case ) {
42
		global $wgGrammarForms;
43
		if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) {
44
			return $wgGrammarForms['bs'][$case][$word];
45
		}
46
		switch ( $case ) {
47
			case 'instrumental': # instrumental
48
				$word = 's ' . $word;
49
			break;
50
			case 'lokativ': # locative
51
				$word = 'o ' . $word;
52
			break;
53
		}
54
55
		# this will return the original value for 'nominativ' (nominative)
56
		# and all undefined case values.
57
		return $word;
58
	}
59
}
60

languages/classes/LanguageDsb.php 1 location

@@ 30-57 (lines=28) @@
27
 *
28
 * @ingroup Language
29
 */
30
class LanguageDsb extends Language {
31
	/**
32
	 * Convert from the nominative form of a noun to some other case
33
	 * Invoked with {{grammar:case|word}}
34
	 *
35
	 * @param string $word
36
	 * @param string $case
37
	 * @return string
38
	 */
39
	function convertGrammar( $word, $case ) {
40
		global $wgGrammarForms;
41
		if ( isset( $wgGrammarForms['dsb'][$case][$word] ) ) {
42
			return $wgGrammarForms['dsb'][$case][$word];
43
		}
44
45
		switch ( $case ) {
46
			case 'instrumental': # instrumental
47
				$word = 'z ' . $word;
48
			case 'lokatiw': # lokatiw
49
				$word = 'wo ' . $word;
50
				break;
51
		}
52
53
		# this will return the original value for 'nominatiw' (nominativ) and
54
		# all undefined case values.
55
		return $word;
56
	}
57
}
58

languages/classes/LanguageHsb.php 1 location

@@ 29-57 (lines=29) @@
26
 *
27
 * @ingroup Language
28
 */
29
class LanguageHsb extends Language {
30
	/**
31
	 * Convert from the nominative form of a noun to some other case
32
	 * Invoked with {{grammar:case|word}}
33
	 *
34
	 * @param string $word
35
	 * @param string $case
36
	 * @return string
37
	 */
38
	function convertGrammar( $word, $case ) {
39
		global $wgGrammarForms;
40
		if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) {
41
			return $wgGrammarForms['hsb'][$case][$word];
42
		}
43
44
		switch ( $case ) {
45
			case 'instrumental': # instrumental
46
				$word = 'z ' . $word;
47
				break;
48
			case 'lokatiw': # lokatiw
49
				$word = 'wo ' . $word;
50
				break;
51
		}
52
53
		# this will return the original value for 'nominatiw' (nominativ) and
54
		# all undefined case values.
55
		return $word;
56
	}
57
}
58