11 class LanguageHe
extends Language
{
13 * Convert grammar forms of words.
16 * "prefixed" (or "תחילית") - when the word has a prefix
18 * @param string the word to convert
19 * @param string the case
21 public function convertGrammar( $word, $case ) {
22 global $wgGrammarForms;
23 if ( isset($wgGrammarForms['he'][$case][$word]) ) {
24 return $wgGrammarForms['he'][$case][$word];
30 # Duplicate the "Waw" if prefixed
31 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
35 # Remove the "He" if prefixed
36 if ( substr( $word, 0, 2 ) == "ה" ) {
37 $word = substr( $word, 2 );
40 # Add a hyphen if non-Hebrew letters
41 if ( substr( $word, 0, 2 ) < "א" ||
substr( $word, 0, 2 ) > "ת" ) {
50 * Gets a number and uses the suited form of the word.
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)
57 * @return string of the suited form of word
59 public function convertPlural( $count, $w1, $w2, $w3) {
60 if ( $count == '1' ) {
62 } elseif ( $count == '2' && $w3 ) {