MediaWiki  REL1_22
LanguageBe_tarask.php
Go to the documentation of this file.
00001 <?php
00033 class LanguageBe_tarask extends Language {
00044     function normalizeForSearch( $string ) {
00045         wfProfileIn( __METHOD__ );
00046 
00047         # MySQL fulltext index doesn't grok utf-8, so we
00048         # need to fold cases and convert to hex
00049 
00050         # Replacing apostrophe sign U+2019 with U+0027
00051         $s = preg_replace( '/\xe2\x80\x99/', '\'', $string );
00052 
00053         $s = parent::normalizeForSearch( $s );
00054 
00055         wfProfileOut( __METHOD__ );
00056         return $s;
00057     }
00058 
00067     function commafy( $_ ) {
00068         if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) {
00069             return $_;
00070         } else {
00071             return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
00072         }
00073     }
00074 }