Ejemplo n.º 1
0
 /**
  * word segmentation
  *
  * @param string $string
  * @param string $autoVariant
  * @return string
  */
 function normalizeForSearch($string, $autoVariant = 'gan-hans')
 {
     // LanguageZh::normalizeForSearch
     return parent::normalizeForSearch($string, $autoVariant);
 }
Ejemplo n.º 2
0
 function stripForSearch($string)
 {
     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);
     //always convert to gan-hans before indexing. it should be
     //better to use gan-hans for search, since conversion from
     //Traditional to Simplified is less ambiguous than the
     //other way around
     $t = $this->mConverter->autoConvert($t, 'gan-hans');
     $t = parent::stripForSearch($t);
     wfProfileOut(__METHOD__);
     return $t;
 }