MediaWiki
REL1_19
|
00001 <?php 00002 00007 class LanguageLa extends Language { 00021 function convertGrammar( $word, $case ) { 00022 global $wgGrammarForms; 00023 if ( isset( $wgGrammarForms['la'][$case][$word] ) ) { 00024 return $wgGrammarForms['la'][$case][$word]; 00025 } 00026 00027 switch ( $case ) { 00028 case 'genitive': 00029 // only a few declensions, and even for those mostly the singular only 00030 $in = array( '/u[ms]$/', # 2nd declension singular 00031 '/ommunia$/', # 3rd declension neuter plural (partly) 00032 '/a$/', # 1st declension singular 00033 '/libri$/', '/nuntii$/', # 2nd declension plural (partly) 00034 '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly) 00035 '/es$/' # 5th declension singular 00036 ); 00037 $out = array( 'i', 00038 'ommunium', 00039 'ae', 00040 'librorum', 'nuntiorum', 00041 'tionis', 'ntis', 'atis', 00042 'ei' 00043 ); 00044 return preg_replace( $in, $out, $word ); 00045 case 'accusative': 00046 // only a few declensions, and even for those mostly the singular only 00047 $in = array( '/u[ms]$/', # 2nd declension singular 00048 '/a$/', # 1st declension singular 00049 '/ommuniam$/', # 3rd declension neuter plural (partly) 00050 '/libri$/', '/nuntii$/', # 2nd declension plural (partly) 00051 '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly) 00052 '/es$/' # 5th declension singular 00053 ); 00054 $out = array( 'um', 00055 'am', 00056 'ommunia', 00057 'libros', 'nuntios', 00058 'tionem', 'ntem', 'atem', 00059 'em' 00060 ); 00061 return preg_replace( $in, $out, $word ); 00062 case 'ablative': 00063 // only a few declensions, and even for those mostly the singular only 00064 $in = array( '/u[ms]$/', # 2nd declension singular 00065 '/ommunia$/', # 3rd declension neuter plural (partly) 00066 '/a$/', # 1st declension singular 00067 '/libri$/', '/nuntii$/', # 2nd declension plural (partly) 00068 '/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly) 00069 '/es$/' # 5th declension singular 00070 ); 00071 $out = array( 'o', 00072 'ommunibus', 00073 'a', 00074 'libris', 'nuntiis', 00075 'tione', 'nte', 'ate', 00076 'e' 00077 ); 00078 return preg_replace( $in, $out, $word ); 00079 default: 00080 return $word; 00081 } 00082 } 00083 }