MediaWiki  REL1_22
LanguageHe.php
Go to the documentation of this file.
00001 <?php
00030 class LanguageHe extends Language {
00031 
00043     public function convertGrammar( $word, $case ) {
00044         global $wgGrammarForms;
00045         if ( isset( $wgGrammarForms['he'][$case][$word] ) ) {
00046             return $wgGrammarForms['he'][$case][$word];
00047         }
00048 
00049         switch ( $case ) {
00050             case 'prefixed':
00051             case 'תחילית':
00052                 # Duplicate the "Waw" if prefixed, but not if it is already double.
00053                 if ( substr( $word, 0, 2 ) === "ו" && substr( $word, 0, 4 ) !== "וו" ) {
00054                     $word = "ו" . $word;
00055                 }
00056 
00057                 # Remove the "He" article if prefixed.
00058                 if ( substr( $word, 0, 2 ) === "ה" ) {
00059                     $word = substr( $word, 2 );
00060                 }
00061 
00062                 # Add a hyphen (maqaf) before non-Hebrew letters.
00063                 if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
00064                     $word = "־" . $word;
00065                 }
00066         }
00067 
00068         return $word;
00069     }
00070 }