Index: branches/REL1_16/phase3/languages/classes/LanguageZh_hans.php |
— | — | @@ -25,6 +25,8 @@ |
26 | 26 | // Double-width roman characters |
27 | 27 | $s = self::convertDoubleWidth( $string ); |
28 | 28 | $s = trim( $s ); |
| 29 | + $s = self::wordSegmentation( $s ); |
| 30 | + $s = self::convertDoubleWidth( $s ); |
29 | 31 | $s = parent::normalizeForSearch( $s ); |
30 | 32 | |
31 | 33 | wfProfileOut( __METHOD__ ); |
Index: branches/REL1_16/phase3/includes/search/SearchUpdate.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | |
39 | 39 | if( $this->mText === false ) { |
40 | 40 | $search->updateTitle($this->mId, |
41 | | - Title::indexTitle( $this->mNamespace, $this->mTitle )); |
| 41 | + $search->normalizeText( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) ); |
42 | 42 | wfProfileOut( $fname ); |
43 | 43 | return; |
44 | 44 | } |
— | — | @@ -97,8 +97,8 @@ |
98 | 98 | wfRunHooks( 'SearchUpdate', array( $this->mId, $this->mNamespace, $this->mTitle, &$text ) ); |
99 | 99 | |
100 | 100 | # Perform the actual update |
101 | | - $search->update($this->mId, Title::indexTitle( $this->mNamespace, $this->mTitle ), |
102 | | - $text); |
| 101 | + $search->update($this->mId, $search->normalizeText( Title::indexTitle( $this->mNamespace, $this->mTitle ) ), |
| 102 | + $search->normalizeText( $text ) ); |
103 | 103 | |
104 | 104 | wfProfileOut( $fname ); |
105 | 105 | } |
Index: branches/REL1_16/phase3/includes/search/SearchEngine.php |
— | — | @@ -56,7 +56,10 @@ |
57 | 57 | * @return string |
58 | 58 | */ |
59 | 59 | public function normalizeText( $string ) { |
60 | | - return $string; |
| 60 | + global $wgContLang; |
| 61 | + |
| 62 | + // Some languages such as Chinese require word segmentation |
| 63 | + return $wgContLang->wordSegmentation( $string ); |
61 | 64 | } |
62 | 65 | |
63 | 66 | /** |
Index: branches/REL1_16/phase3/includes/search/SearchMySQL.php |
— | — | @@ -325,8 +325,7 @@ |
326 | 326 | |
327 | 327 | wfProfileIn( __METHOD__ ); |
328 | 328 | |
329 | | - // Some languages such as Chinese require word segmentation |
330 | | - $out = $wgContLang->wordSegmentation( $string ); |
| 329 | + $out = parent::normalizeText( $string ); |
331 | 330 | |
332 | 331 | // MySQL fulltext index doesn't grok utf-8, so we |
333 | 332 | // need to fold cases and convert to hex |