summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageYue.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /languages/classes/LanguageYue.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'languages/classes/LanguageYue.php')
-rw-r--r--languages/classes/LanguageYue.php31
1 files changed, 21 insertions, 10 deletions
diff --git a/languages/classes/LanguageYue.php b/languages/classes/LanguageYue.php
index fc7f233c..6581d788 100644
--- a/languages/classes/LanguageYue.php
+++ b/languages/classes/LanguageYue.php
@@ -3,19 +3,30 @@
* @ingroup Language
*/
class LanguageYue extends Language {
- function stripForSearch( $string ) {
+ function hasWordBreaks() {
+ return false;
+ }
+
+ /**
+ * Eventually this should be a word segmentation;
+ * for now just treat each character as a word.
+ * @todo Fixme: only do this for Han characters...
+ */
+ function wordSegmentation( $string ) {
+ $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
+ $s = self::insertSpace( $string, $reg );
+ return $s;
+ }
+
+ function normalizeForSearch( $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);
+ // Double-width roman characters
+ $s = self::convertDoubleWidth( $string );
+ $s = trim( $s );
+ $s = parent::normalizeForSearch( $s );
- // Do general case folding and UTF-8 armoring
- $t = parent::stripForSearch( $t );
wfProfileOut( __METHOD__ );
- return $t;
+ return $s;
}
}