8 * @author Rotem Dan (July 2003)
9 * @author Rotem Liss (March 2006 on)
12 class LanguageHe
extends Language
{
14 * Convert grammar forms of words.
17 * "prefixed" (or "תחילית") - when the word has a prefix
19 * @param string the word to convert
20 * @param string the case
22 public function convertGrammar( $word, $case ) {
23 global $wgGrammarForms;
24 if ( isset($wgGrammarForms['he'][$case][$word]) ) {
25 return $wgGrammarForms['he'][$case][$word];
31 # Duplicate the "Waw" if prefixed
32 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
36 # Remove the "He" if prefixed
37 if ( substr( $word, 0, 2 ) == "ה" ) {
38 $word = substr( $word, 2 );
41 # Add a hyphen if non-Hebrew letters
42 if ( substr( $word, 0, 2 ) < "א" ||
substr( $word, 0, 2 ) > "ת" ) {
51 * Gets a number and uses the suited form of the word.
53 * @param integer the number of items
54 * @param string the first form (singular)
55 * @param string the second form (plural)
56 * @param string the third form (2 items, plural is used if not applicable and not specified)
58 * @return string of the suited form of word
60 public function convertPlural( $count, $w1, $w2, $w3) {
61 if ( $count == '1' ) {
63 } elseif ( $count == '2' && $w3 ) {