00001 <?php
00002
00010 class LanguageHe extends Language {
00020 public function convertGrammar( $word, $case ) {
00021 global $wgGrammarForms;
00022 if ( isset($wgGrammarForms['he'][$case][$word]) ) {
00023 return $wgGrammarForms['he'][$case][$word];
00024 }
00025
00026 switch ( $case ) {
00027 case 'prefixed':
00028 case 'תחילית':
00029 # Duplicate the "Waw" if prefixed
00030 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
00031 $word = "ו".$word;
00032 }
00033
00034 # Remove the "He" if prefixed
00035 if ( substr( $word, 0, 2 ) == "ה" ) {
00036 $word = substr( $word, 2 );
00037 }
00038
00039 # Add a hyphen if non-Hebrew letters
00040 if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
00041 $word = "־".$word;
00042 }
00043 }
00044
00045 return $word;
00046 }
00047
00060 function convertPlural( $count, $forms ) {
00061 if ( !count($forms) ) { return ''; }
00062 $forms = $this->preConvertPlural( $forms, 3 );
00063
00064 if ( $count == '1' ) {
00065 return $forms[0];
00066 } elseif ( $count == '2' && isset($forms[2]) ) {
00067 return $forms[2];
00068 } else {
00069 return $forms[1];
00070 }
00071 }
00072 }