2003-12-18 02:41:39 +00:00
|
|
|
<?php
|
2005-04-09 05:30:15 +00:00
|
|
|
/** Latin (lingua Latina)
|
|
|
|
|
*
|
2007-01-20 15:09:52 +00:00
|
|
|
* @addtogroup Language
|
2005-04-05 11:00:27 +00:00
|
|
|
*/
|
2003-12-18 02:41:39 +00:00
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageLa extends Language {
|
2005-05-06 02:38:42 +00:00
|
|
|
/**
|
|
|
|
|
* Convert from the nominative form of a noun to some other case
|
|
|
|
|
*
|
|
|
|
|
* Just used in a couple places for sitenames; special-case as necessary.
|
|
|
|
|
* Rules are far from complete.
|
2006-06-11 15:40:17 +00:00
|
|
|
*
|
2007-02-07 21:20:43 +00:00
|
|
|
* Cases: genitive, accusative, ablative
|
2005-05-06 02:38:42 +00:00
|
|
|
*/
|
|
|
|
|
function convertGrammar( $word, $case ) {
|
2006-05-25 14:31:28 +00:00
|
|
|
global $wgGrammarForms;
|
2006-05-25 20:52:45 +00:00
|
|
|
if ( isset($wgGrammarForms['la'][$case][$word]) ) {
|
|
|
|
|
return $wgGrammarForms['la'][$case][$word];
|
2006-05-25 14:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
2005-05-06 02:38:42 +00:00
|
|
|
switch ( $case ) {
|
|
|
|
|
case 'genitive':
|
2007-02-07 21:20:43 +00:00
|
|
|
// only a few declensions, and even for those mostly the singular only
|
|
|
|
|
$in = array( '/u[ms]$/', # 2nd declension singular
|
|
|
|
|
'/ommunia$/', # 3rd declension neuter plural (partly)
|
|
|
|
|
'/a$/', # 1st declension singular
|
|
|
|
|
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
|
|
|
|
|
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
|
|
|
|
|
'/es$/' # 5th declension singular
|
|
|
|
|
);
|
|
|
|
|
$out = array( 'i',
|
|
|
|
|
'ommunium',
|
|
|
|
|
'ae',
|
|
|
|
|
'librorum', 'nuntiorum',
|
|
|
|
|
'tionis', 'ntis', 'atis',
|
|
|
|
|
'ei'
|
|
|
|
|
);
|
|
|
|
|
return preg_replace( $in, $out, $word );
|
|
|
|
|
case 'accusative':
|
|
|
|
|
// only a few declensions, and even for those mostly the singular only
|
|
|
|
|
$in = array( '/u[ms]$/', # 2nd declension singular
|
|
|
|
|
'/ommunia$/', # 3rd declension neuter plural (partly)
|
|
|
|
|
'/a$/', # 1st declension singular
|
|
|
|
|
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
|
|
|
|
|
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
|
|
|
|
|
'/es$/' # 5th declension singular
|
|
|
|
|
);
|
|
|
|
|
$out = array( 'um',
|
|
|
|
|
'ommunia',
|
|
|
|
|
'am',
|
|
|
|
|
'libros', 'nuntios',
|
|
|
|
|
'tionem', 'ntem', 'atem',
|
|
|
|
|
'em'
|
|
|
|
|
);
|
|
|
|
|
return preg_replace( $in, $out, $word );
|
|
|
|
|
case 'ablative':
|
|
|
|
|
// only a few declensions, and even for those mostly the singular only
|
|
|
|
|
$in = array( '/u[ms]$/', # 2nd declension singular
|
|
|
|
|
'/ommunia$/', # 3rd declension neuter plural (partly)
|
|
|
|
|
'/a$/', # 1st declension singular
|
|
|
|
|
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
|
|
|
|
|
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
|
|
|
|
|
'/es$/' # 5th declension singular
|
|
|
|
|
);
|
|
|
|
|
$out = array( 'o',
|
|
|
|
|
'ommunibus',
|
|
|
|
|
'a',
|
|
|
|
|
'libris', 'nuntiis',
|
|
|
|
|
'tione', 'nte', 'ate',
|
|
|
|
|
'e'
|
|
|
|
|
);
|
2005-05-06 02:38:42 +00:00
|
|
|
return preg_replace( $in, $out, $word );
|
|
|
|
|
default:
|
|
|
|
|
return $word;
|
|
|
|
|
}
|
2004-02-28 07:23:04 +00:00
|
|
|
}
|
2003-12-18 02:41:39 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-28 07:23:04 +00:00
|
|
|
|
2004-03-20 15:03:26 +00:00
|
|
|
?>
|