10 class LanguageHe
extends Language
{
13 * Convert grammar forms of words.
16 * "prefixed" (or "תחילית") - when the word has a prefix
18 * @param $word String: the word to convert
19 * @param $case String: the case
23 public function convertGrammar( $word, $case ) {
24 global $wgGrammarForms;
25 if ( isset( $wgGrammarForms['he'][$case][$word] ) ) {
26 return $wgGrammarForms['he'][$case][$word];
32 # Duplicate the "Waw" if prefixed
33 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
37 # Remove the "He" if prefixed
38 if ( substr( $word, 0, 2 ) == "ה" ) {
39 $word = substr( $word, 2 );
42 # Add a hyphen (maqaf) if non-Hebrew letters
43 if ( substr( $word, 0, 2 ) < "א" ||
substr( $word, 0, 2 ) > "ת" ) {
52 * Gets a number and uses the suited form of the word.
54 * @param $count Integer: the number of items
55 * @param $forms Array with 3 items: the three plural forms
56 * @return String: the suited form of word
58 function convertPlural( $count, $forms ) {
59 if ( !count( $forms ) ) { return ''; }
60 $forms = $this->preConvertPlural( $forms, 3 );
63 return $forms[0]; // Singular
64 } elseif ( $count == 2 ) {
65 return $forms[2]; // Dual or plural if dual is not provided (filled in preConvertPlural)
67 return $forms[1]; // Plural