Index: trunk/phase3/languages/classes/LanguageHe.php |
— | — | @@ -8,21 +8,22 @@ |
9 | 9 | * @author Rotem Liss |
10 | 10 | */ |
11 | 11 | class LanguageHe extends Language { |
| 12 | + |
12 | 13 | /** |
13 | 14 | * Convert grammar forms of words. |
14 | 15 | * |
15 | 16 | * Available cases: |
16 | 17 | * "prefixed" (or "תחילית") - when the word has a prefix |
17 | 18 | * |
18 | | - * @param string the word to convert |
19 | | - * @param string the case |
| 19 | + * @param $word String: the word to convert |
| 20 | + * @param $case String: the case |
20 | 21 | */ |
21 | 22 | public function convertGrammar( $word, $case ) { |
22 | 23 | global $wgGrammarForms; |
23 | 24 | if ( isset($wgGrammarForms['he'][$case][$word]) ) { |
24 | 25 | return $wgGrammarForms['he'][$case][$word]; |
25 | 26 | } |
26 | | - |
| 27 | + |
27 | 28 | switch ( $case ) { |
28 | 29 | case 'prefixed': |
29 | 30 | case 'תחילית': |
— | — | @@ -30,32 +31,27 @@ |
31 | 32 | if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) { |
32 | 33 | $word = "ו".$word; |
33 | 34 | } |
34 | | - |
| 35 | + |
35 | 36 | # Remove the "He" if prefixed |
36 | 37 | if ( substr( $word, 0, 2 ) == "ה" ) { |
37 | 38 | $word = substr( $word, 2 ); |
38 | 39 | } |
39 | | - |
| 40 | + |
40 | 41 | # Add a hyphen if non-Hebrew letters |
41 | 42 | if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) { |
42 | 43 | $word = "־".$word; |
43 | 44 | } |
44 | 45 | } |
45 | | - |
| 46 | + |
46 | 47 | return $word; |
47 | 48 | } |
48 | | - |
| 49 | + |
49 | 50 | /** |
50 | 51 | * Gets a number and uses the suited form of the word. |
51 | 52 | * |
52 | | - * @param integer the number of items |
53 | | - * @param string the first form (singular) |
54 | | - * @param string the second form (plural) |
55 | | - * @param string the third form (2 items, plural is used if not applicable and not specified |
56 | | - * @param not used (for compatibility with ancestor) |
57 | | - * @param not used (for compatibility with ancestor) |
58 | | - * |
59 | | - * @return string of the suited form of word |
| 53 | + * @param $count Integer: the number of items |
| 54 | + * @param $forms Array with 3 items: the three plural forms |
| 55 | + * @return String: the suited form of word |
60 | 56 | */ |
61 | 57 | function convertPlural( $count, $forms ) { |
62 | 58 | if ( !count($forms) ) { return ''; } |