10 class LanguageHe
extends Language
{
12 * Convert grammar forms of words.
15 * "prefixed" (or "תחילית") - when the word has a prefix
17 * @param string the word to convert
18 * @param string the case
20 public function convertGrammar( $word, $case ) {
21 global $wgGrammarForms;
22 if ( isset($wgGrammarForms['he'][$case][$word]) ) {
23 return $wgGrammarForms['he'][$case][$word];
29 # Duplicate the "Waw" if prefixed
30 if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
34 # Remove the "He" if prefixed
35 if ( substr( $word, 0, 2 ) == "ה" ) {
36 $word = substr( $word, 2 );
39 # Add a hyphen if non-Hebrew letters
40 if ( substr( $word, 0, 2 ) < "א" ||
substr( $word, 0, 2 ) > "ת" ) {
49 * Gets a number and uses the suited form of the word.
51 * @param integer the number of items
52 * @param string the first form (singular)
53 * @param string the second form (plural)
54 * @param string the third form (2 items, plural is used if not applicable and not specified
55 * @param not used (for compatibility with ancestor)
56 * @param not used (for compatibility with ancestor)
58 * @return string of the suited form of word
60 function convertPlural( $count, $forms ) {
61 if ( !count($forms) ) { return ''; }
62 $forms = $this->preConvertPlural( $forms, 3 );
64 if ( $count == '1' ) {
66 } elseif ( $count == '2' && isset($forms[2]) ) {