const L_F_UC = 'EİÖÜ'; # Crimean Tatar Latin uppercase front vowels
const L_F = 'eiöüEİÖÜ'; # Crimean Tatar Latin front vowels
+ /**
+ * @param Language $langobj
+ * @param string $maincode
+ * @param array $variants
+ * @param array $variantfallbacks
+ * @param array $flags
+ */
+ function __construct( $langobj, $maincode,
+ $variants = [],
+ $variantfallbacks = [],
+ $flags = [] ) {
+ parent::__construct( $langobj, $maincode,
+ $variants, $variantfallbacks, $flags );
+
+ // No point delaying this since they're in code.
+ // Waiting until loadDefaultTables() means they never get loaded
+ // when the tables themselves are loaded from cache.
+ $this->loadExceptions();
+ }
+
public $mCyrillicToLatin = [
## these are independent of location in the word, but have
// hack, hack, hack
'A' => 'А', 'a' => 'а', 'E' => 'Е', 'e' => 'е',
- 'Ö' => 'О', 'ö' => 'о', 'U' => 'У', 'u' => 'у',
- 'Ü' => 'У', 'ü' => 'у', 'Y' => 'Й', 'y' => 'й',
-
+ 'Ö' => 'Ё', 'ö' => 'ё', 'U' => 'У', 'u' => 'у',
+ 'Ü' => 'Ю', 'ü' => 'ю', 'Y' => 'Й', 'y' => 'й',
'C' => 'Дж', 'c' => 'дж', 'Ğ' => 'Гъ', 'ğ' => 'гъ',
'Ñ' => 'Нъ', 'ñ' => 'нъ', 'Q' => 'Къ', 'q' => 'къ',
];
}
- function postLoadTables() {
- $this->loadExceptions();
- }
-
function loadExceptions() {
if ( $this->mExceptionsLoaded ) {
return;
}
// check for roman numbers like VII, XIX...
- $roman = '/^M{0,3}(C[DM]|D{0,1}C{0,3})(X[LC]|L{0,1}X{0,3})(I[VX]|V{0,1}I{0,3})$/u';
+ // Lookahead assertion ensures $roman doesn't match the empty string
+ $roman = '/^(?=[MDCLXVI])M{0,4}(C[DM]|D?C{0,3})(X[LC]|L?X{0,3})(I[VX]|V?I{0,3})$/u';
# match any sub-string of the relevant letters and convert it
$matches = preg_split( '/(\b|^)[^' . $letters . ']+(\b|$)/u',