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
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 $count Integer: the number of items
53 * @param $forms Array with 3 items: the three plural forms
54 * @return String: the suited form of word
56 function convertPlural( $count, $forms ) {
57 if ( !count( $forms ) ) { return ''; }
58 $forms = $this->preConvertPlural( $forms, 3 );
60 if ( $count == '1' ) {
62 } elseif ( $count == '2' && isset( $forms[2] ) ) {