* @ingroup Language
*/
class LanguageYue extends Language {
- function stripForSearch( $string ) {
+ function stripForSearch( $string, $doStrip = true ) {
wfProfileIn( __METHOD__ );
- // eventually this should be a word segmentation
- // for now just treat each character as a word
- // @fixme only do this for Han characters...
- $t = preg_replace(
- "/([\\xc0-\\xff][\\x80-\\xbf]*)/",
- " $1", $string);
+ // Double-width roman characters
+ $s = self::convertDoubleWidth( $string );
+
+ if ( $doStrip == true ) {
+ // eventually this should be a word segmentation;
+ // for now just treat each character as a word.
+ // @todo Fixme: only do this for Han characters...
+ $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
+ $s = self::wordSegmentation( $s, $reg );
+ }
+
+ $s = trim( $s );
// Do general case folding and UTF-8 armoring
- $t = parent::stripForSearch( $t );
+ $s = parent::stripForSearch( $s, $doStrip );
wfProfileOut( __METHOD__ );
- return $t;
+ return $s;
}
}