More documentation!
authorSam Reed <reedy@users.mediawiki.org>
Sun, 29 May 2011 16:32:05 +0000 (16:32 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 29 May 2011 16:32:05 +0000 (16:32 +0000)
19 files changed:
languages/classes/LanguageCu.php
languages/classes/LanguageDsb.php
languages/classes/LanguageEo.php
languages/classes/LanguageFi.php
languages/classes/LanguageGa.php
languages/classes/LanguageGan.php
languages/classes/LanguageHsb.php
languages/classes/LanguageHy.php
languages/classes/LanguageIu.php
languages/classes/LanguageKaa.php
languages/classes/LanguageKk.php
languages/classes/LanguageKk_cyrl.php
languages/classes/LanguageKu.php
languages/classes/LanguageRu.php
languages/classes/LanguageSr.php
languages/classes/LanguageTr.php
languages/classes/LanguageUk.php
languages/classes/LanguageWa.php
languages/classes/LanguageZh.php

index 8eccc84..af42d2c 100644 (file)
@@ -5,8 +5,15 @@
  * @ingroup Language
  */
 class LanguageCu extends Language {
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{grammar:case|word}}
+
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) {
index 04bd0e2..1fae25c 100644 (file)
@@ -6,9 +6,14 @@
  */
 class LanguageDsb extends Language {
 
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{GRAMMAR:case|word}}
-
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['dsb'][$case][$word] ) ) {
index 7ec447e..07fe6fd 100644 (file)
@@ -51,6 +51,10 @@ class LanguageEo extends Language {
                return parent::iconv( $in, $out, $string );
        }
 
+       /**
+        * @param $matches array
+        * @return string
+        */
        function strrtuxCallback( $matches ) {
                static $ux = array (
                        'x' => 'xx' , 'X' => 'Xx' ,
@@ -64,6 +68,10 @@ class LanguageEo extends Language {
                return strtr( $matches[1], $ux );
        }
 
+       /**
+        * @param $matches array
+        * @return string
+        */
        function strrtxuCallback( $matches ) {
                static $xu = array (
                        'xx' => 'x' , 'xX' => 'x' ,
@@ -84,6 +92,10 @@ class LanguageEo extends Language {
                return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu );
        }
 
+       /**
+        * @param $s string
+        * @return string
+        */
        function checkTitleEncoding( $s ) {
                # Check for X-system backwards-compatibility URLs
                $ishigh = preg_match( '/[\x80-\xff]/', $s );
index e3d922c..7156b65 100644 (file)
@@ -8,8 +8,14 @@
  */
 class LanguageFi extends Language {
 
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{GRAMMAR:case|word}}
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) {
@@ -55,6 +61,11 @@ class LanguageFi extends Language {
                return $word;
        }
 
+       /**
+        * @param $str string
+        * @param $forContent bool
+        * @return string
+        */
        function translateBlockExpiry( $str, $forContent = false ) {
                /*
                        'ago', 'now', 'today', 'this', 'next',
index 74d154c..43050e1 100644 (file)
@@ -5,8 +5,15 @@
  * @ingroup Language
  */
 class LanguageGa extends Language {
-       # Convert day names
-       # Invoked with {{GRAMMAR:transformation|word}}
+
+       /**
+        * Convert day names
+        * Invoked with {{GRAMMAR:transformation|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) {
index da5e1d2..99b4c29 100644 (file)
@@ -8,6 +8,14 @@ require_once( dirname( __FILE__ ) . '/LanguageZh.php' );
  */
 class GanConverter extends LanguageConverter {
 
+       /**
+        * @param $langobj Language
+        * @param $maincode string
+        * @param $variants array
+        * @param $variantfallbacks array
+        * @param $flags array
+        * @param $manualLevel array
+        */
        function __construct( $langobj, $maincode,
                                                                $variants = array(),
                                                                $variantfallbacks = array(),
@@ -37,14 +45,24 @@ class GanConverter extends LanguageConverter {
                );
        }
 
-       /* there shouldn't be any latin text in Chinese conversion, so no need
-          to mark anything.
-          $noParse is there for compatibility with LanguageConvert::markNoConversion
+       /**
+        * there shouldn't be any latin text in Chinese conversion, so no need
+        * to mark anything.
+        * $noParse is there for compatibility with LanguageConvert::markNoConversion
+        *
+        * @param $text string
+        * @param $noParse bool
+        *
+        * @return string
         */
        function markNoConversion( $text, $noParse = false ) {
                return $text;
        }
 
+       /**
+        * @param $key string
+        * @return String
+        */
        function convertCategoryKey( $key ) {
                return $this->autoConvert( $key, 'gan' );
        }
@@ -80,25 +98,44 @@ class LanguageGan extends LanguageZh {
                $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
        }
 
-       # this should give much better diff info
+       /**
+        * this should give much better diff info
+        *
+        * @param $text string
+        * @return string
+        */
        function segmentForDiff( $text ) {
                return preg_replace(
                        "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                        "' ' .\"$1\"", $text );
        }
 
+       /**
+        * @param $text string
+        * @return string
+        */
        function unsegmentForDiff( $text ) {
                return preg_replace(
                        "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                        "\"$1\"", $text );
        }
 
-       // word segmentation
+       /**
+        * word segmentation
+        *
+        * @param $string string
+        * @param $autoVariant string
+        * @return String
+        */
        function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
                // LanguageZh::normalizeForSearch
                return parent::normalizeForSearch( $string, $autoVariant );
        }
 
+       /**
+        * @param $termsArray array
+        * @return array
+        */
        function convertForSearchResult( $termsArray ) {
                $terms = implode( '|', $termsArray );
                $terms = self::convertDoubleWidth( $terms );
index 2e0060b..1b67aa0 100644 (file)
@@ -6,9 +6,14 @@
 
 class LanguageHsb extends Language {
 
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{GRAMMAR:case|word}}
-
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) {
index 0da090c..c14106c 100644 (file)
@@ -6,8 +6,15 @@
  * @author Ruben Vardanyan (Me@RubenVardanyan.com)
  */
 class LanguageHy extends Language {
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{grammar:case|word}}
+
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['hy'][$case][$word] ) ) {
index 5251011..c6221de 100644 (file)
@@ -17,6 +17,9 @@
 */
 require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
 
+/**
+ *
+ */
 class IuConverter extends LanguageConverter {
        var $mToLatin = array(
                'ᐦ' => 'h',   'ᐃ' => 'i',    'ᐄ' => 'ii',    'ᐅ' => 'u',    'ᐆ' => 'uu',    'ᐊ' => 'a',    'ᐋ' => 'aa',
@@ -76,11 +79,16 @@ class IuConverter extends LanguageConverter {
                );
        }
 
-       /* rules should be defined as -{Syllabic | Latin-} -or-
-               -{code:text | code:text | ...}-
-               update: delete all rule parsing because it's not used
-                       currently, and just produces a couple of bugs
-       */
+       /**
+        * rules should be defined as -{Syllabic | Latin-} -or-
+        * -{code:text | code:text | ...}-
+        * update: delete all rule parsing because it's not used
+        * currently, and just produces a couple of bugs
+        *
+        * @param $rule string
+        * @param $flags array
+        * @return array
+        */
        function parseManualRule( $rule, $flags = array() ) {
                if ( in_array( 'T', $flags ) ) {
                        return parent::parseManualRule( $rule, $flags );
@@ -95,7 +103,13 @@ class IuConverter extends LanguageConverter {
                return $carray;
        }
 
-       // Do not convert content on talk pages
+       /**
+        * Do not convert content on talk pages
+        *
+        * @param $text string
+        * @param $parser Parser
+        * @return string
+        */
        function parserConvert( $text, &$parser ) {
                if ( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() )
                        $this->mDoContentConvert = false;
@@ -110,6 +124,10 @@ class IuConverter extends LanguageConverter {
         *   - if there is no selected variant, leave the link
         *     names as they were
         *   - do not try to find variants for usernames
+        *
+        * @param $link string
+        * @param $nt Title
+        * @param $ignoreOtherCond bool
         */
        function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                 // check for user namespace
@@ -129,6 +147,9 @@ class IuConverter extends LanguageConverter {
         * We want our external link captions to be converted in variants,
         * so we return the original text instead -{$text}-, except for URLs
         *
+        * @param $text string
+        * @param $noParse bool
+        *
         * @return string
         */
        function markNoConversion( $text, $noParse = false ) {
@@ -141,6 +162,9 @@ class IuConverter extends LanguageConverter {
         * An ugly function wrapper for parsing Image titles
         * (to prevent image name conversion)
         *
+        * @param $text string
+        * @param $toVariant bool
+        *
         * @return string
         */
        function autoConvert( $text, $toVariant = false ) {
@@ -155,6 +179,9 @@ class IuConverter extends LanguageConverter {
        /**
         * It translates text into variant
         *
+        * @param $text string
+        * @param $toVariant bool
+        *
         * @return string
         */
        function translate( $text, $toVariant ) {
index 2225d9e..a40fb7a 100644 (file)
@@ -11,6 +11,9 @@ class LanguageKaa extends Language {
        /**
         * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
         *
+        * @param $word string
+        * @param $case string
+        *
         * @return string
         */
        function convertGrammar( $word, $case ) {
@@ -25,6 +28,8 @@ class LanguageKaa extends Language {
        /**
         * It fixes issue with ucfirst for transforming 'i' to 'İ'
         *
+        * @param $string string
+        *
         * @return string
         */
        function ucfirst ( $string ) {
index 48b57aa..953a3f9 100644 (file)
@@ -20,6 +20,13 @@ class KkConverter extends LanguageConverter {
 
        protected $mCyrl2Latn, $mLatn2Cyrl, $mCyLa2Arab;
 
+       /**
+        * @param $langobj Language
+        * @param $maincode string
+        * @param $variants array
+        * @param $variantfallbacks array
+        * @param $flags array
+        */
        function __construct( $langobj, $maincode,
                                                                $variants = array(),
                                                                $variantfallbacks = array(),
@@ -192,11 +199,17 @@ class KkConverter extends LanguageConverter {
                );
        }
 
-       /* rules should be defined as -{ekavian | iyekavian-} -or-
-               -{code:text | code:text | ...}-
-               update: delete all rule parsing because it's not used
-                               currently, and just produces a couple of bugs
-       */
+       /**
+        * rules should be defined as -{ekavian | iyekavian-} -or-
+        * -{code:text | code:text | ...}-
+        *
+        * update: delete all rule parsing because it's not used
+        *      currently, and just produces a couple of bugs
+        *
+        * @param $rule string
+        * @param $flags array
+        * @return array
+        */
        function parseManualRule( $rule, $flags = array() ) {
                if ( in_array( 'T', $flags ) ) {
                        return parent::parseManualRule( $rule, $flags );
@@ -216,6 +229,10 @@ class KkConverter extends LanguageConverter {
         *  - if there is no selected variant, leave the link
         *    names as they were
         *  - do not try to find variants for usernames
+        *
+        * @param $link string
+        * @param $nt Title
+        * @param bool $ignoreOtherCond
         */
        function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                // check for user namespace
@@ -235,6 +252,9 @@ class KkConverter extends LanguageConverter {
         * An ugly function wrapper for parsing Image titles
         * (to prevent image name conversion)
         *
+        * @param $text string
+        * @param $toVariant bool
+        *
         * @return string
         */
        function autoConvert( $text, $toVariant = false ) {
@@ -249,6 +269,9 @@ class KkConverter extends LanguageConverter {
        /**
         *  It translates text into variant
         *
+        * @param $text string
+        * @param $toVariant string
+        *
         * @return string
         */
        function translate( $text, $toVariant ) {
@@ -289,6 +312,11 @@ class KkConverter extends LanguageConverter {
                return $ret;
        }
 
+       /**
+        * @param $text string
+        * @param $toVariant string
+        * @return mixed|string
+        */
        function regsConverter( $text, $toVariant ) {
                if ( $text == '' ) {
                        return $text;
@@ -345,6 +373,9 @@ class KkConverter extends LanguageConverter {
         * We want our external link captions to be converted in variants,
         * so we return the original text instead -{$text}-, except for URLs
         *
+        * @param $text string
+        * @param $noParse string|bool
+        *
         * @return string
         */
        function markNoConversion( $text, $noParse = false ) {
index a263225..ba84bf9 100644 (file)
@@ -236,6 +236,11 @@ class LanguageKk_cyrl extends Language {
                return $word;
        }
 
+       /**
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammarKk_latn( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
@@ -456,6 +461,11 @@ class LanguageKk_cyrl extends Language {
                return $word;
        }
 
+       /**
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammarKk_arab( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
@@ -676,6 +686,11 @@ class LanguageKk_cyrl extends Language {
                return $word;
        }
 
+       /**
+        * @param $word string
+        * @param $allVowels array
+        * @return array
+        */
        function lastLetter( $word, $allVowels ) {
                $lastLetter = array();
 
index 615c24e..92bca09 100644 (file)
@@ -137,6 +137,10 @@ class KuConverter extends LanguageConverter {
         *   - if there is no selected variant, leave the link
         *     names as they were
         *   - do not try to find variants for usernames
+        *
+        * @param $link string
+        * @param $nt Title
+        * @param $ignoreOtherCond bool
         */
        function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                // check for user namespace
@@ -156,6 +160,9 @@ class KuConverter extends LanguageConverter {
         * We want our external link captions to be converted in variants,
         * so we return the original text instead -{$text}-, except for URLs
         *
+        * @param $text string
+        * @param $noParse bool
+        *
         * @return string
         */
        function markNoConversion( $text, $noParse = false ) {
@@ -168,6 +175,9 @@ class KuConverter extends LanguageConverter {
         * An ugly function wrapper for parsing Image titles
         * (to prevent image name conversion)
         *
+        * @param $text string
+        * @param $toVariant bool
+        *
         * @return string
         */
        function autoConvert( $text, $toVariant = false ) {
@@ -183,6 +193,9 @@ class KuConverter extends LanguageConverter {
         *  It translates text into variant, specials:
         *    - ommiting roman numbers
         *
+        * @param $text string
+        * @param $toVariant bool
+        *
         * @return string
         */
        function translate( $text, $toVariant ) {
index 20d463e..e16761a 100644 (file)
@@ -7,8 +7,15 @@
   * @ingroup Language
   */
 class LanguageRu extends Language {
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{grammar:case|word}}
+
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['ru'][$case][$word] ) ) {
index 3993b0e..466887d 100644 (file)
@@ -58,11 +58,17 @@ class SrConverter extends LanguageConverter {
                );
        }
 
-       /* rules should be defined as -{ekavian | iyekavian-} -or-
-               -{code:text | code:text | ...}-
-               update: delete all rule parsing because it's not used
-                       currently, and just produces a couple of bugs
-       */
+       /**
+        * rules should be defined as -{ekavian | iyekavian-} -or-
+        * -{code:text | code:text | ...}-
+        *
+        * update: delete all rule parsing because it's not used
+        * currently, and just produces a couple of bugs
+        *
+        * @param $rule string
+        * @param $flags array
+        * @return array
+        */
        function parseManualRule( $rule, $flags = array() ) {
                if ( in_array( 'T', $flags ) ) {
                        return parent::parseManualRule( $rule, $flags );
@@ -82,6 +88,10 @@ class SrConverter extends LanguageConverter {
         *   - if there is no selected variant, leave the link
         *     names as they were
         *   - do not try to find variants for usernames
+        *
+        * @param $link string
+        * @param $nt Title
+        * @param $ignoreOtherCond bool
         */
        function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                // check for user namespace
@@ -101,6 +111,9 @@ class SrConverter extends LanguageConverter {
         * We want our external link captions to be converted in variants,
         * so we return the original text instead -{$text}-, except for URLs
         *
+        * @param $text string
+        * @param $noParse bool
+        *
         * @return string
         */
        function markNoConversion( $text, $noParse = false ) {
@@ -113,6 +126,9 @@ class SrConverter extends LanguageConverter {
         * An ugly function wrapper for parsing Image titles
         * (to prevent image name conversion)
         *
+        * @param $text string
+        * @param $toVariant bool
+        *
         * @return string
         */
        function autoConvert( $text, $toVariant = false ) {
@@ -128,6 +144,9 @@ class SrConverter extends LanguageConverter {
         *  It translates text into variant, specials:
         *    - ommiting roman numbers
         *
+        * @param $text string
+        * @param $toVariant string
+        *
         * @return string
         */
        function translate( $text, $toVariant ) {
@@ -161,6 +180,9 @@ class SrConverter extends LanguageConverter {
         * @author Nikola Smolenski <smolensk@eunet.rs>
         * @since 1.18
         *
+        * @param $text string
+        * @param $variant string
+        *
         * @return bool
         */
        public function guessVariant( $text, $variant ) {
index 0b69688..5692c02 100644 (file)
@@ -40,7 +40,7 @@ class LanguageTr extends Language {
         * @see bug 28040
         *
         * @param $string string
-        * @param $first string
+        * @param $first string|bool
         *
         * @return string
         */
@@ -53,7 +53,7 @@ class LanguageTr extends Language {
         * @see bug 28040
         *
         * @param $string string
-        * @param $first string
+        * @param $first string|bool
         *
         * @return string
         */
index 00d8de6..206c5aa 100644 (file)
@@ -5,8 +5,15 @@
  * @ingroup Language
  */
 class LanguageUk extends Language {
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{grammar:case|word}}
+
+       /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{grammar:case|word}}
+        *
+        * @param $word string
+        * @param $case string
+        * @return string
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
                if ( isset( $wgGrammarForms['uk'][$case][$word] ) ) {
index ea4c4e5..25e52ae 100644 (file)
@@ -24,11 +24,17 @@ class LanguageWa extends Language {
                return ( $count <= 1 ) ? $forms[0] : $forms[1];
        }
 
-       ## #
-       ## # Dates in Walloon are "1î d' <monthname>" for 1st of the month,
-       ## # "<day> di <monthname>" for months starting by a consoun, and
-       ## # "<day> d' <monthname>" for months starting with a vowel
-       ## #
+       /**
+        * Dates in Walloon are "1î d' <monthname>" for 1st of the month,
+        * "<day> di <monthname>" for months starting by a consoun, and
+        * "<day> d' <monthname>" for months starting with a vowel
+        *
+        * @param $ts string
+        * @param $adj bool
+        * @param $format bool
+        * @param $tc bool
+        * @return string
+        */
        function date( $ts, $adj = false, $format = true, $tc = false ) {
                $ts = wfTimestamp( TS_MW, $ts );
                if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
@@ -69,6 +75,13 @@ class LanguageWa extends Language {
                return $d;
        }
 
+       /**
+        * @param $ts string
+        * @param $adj bool
+        * @param $format bool
+        * @param $tc bool
+        * @return string
+        */
        function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
                if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
                $datePreference = $this->dateFormat( $format );
index 0055a33..d69929d 100644 (file)
@@ -8,6 +8,14 @@ require_once( dirname( __FILE__ ) . '/LanguageZh_hans.php' );
  */
 class ZhConverter extends LanguageConverter {
 
+       /**
+        * @param $langobj Language
+        * @param $maincode string
+        * @param $variants array
+        * @param $variantfallbacks array
+        * @param $flags array
+        * @param $manualLevel array
+        */
        function __construct( $langobj, $maincode,
                                                                $variants = array(),
                                                                $variantfallbacks = array(),
@@ -58,14 +66,24 @@ class ZhConverter extends LanguageConverter {
                $this->mTables['zh-tw']->merge( $this->mTables['zh-hant'] );
        }
 
-       /* there shouldn't be any latin text in Chinese conversion, so no need
-          to mark anything.
-          $noParse is there for compatibility with LanguageConvert::markNoConversion
+       /**
+        * there shouldn't be any latin text in Chinese conversion, so no need
+        * to mark anything.
+        * $noParse is there for compatibility with LanguageConvert::markNoConversion
+        *
+        * @param $text string
+        * @param $noParse bool
+        *
+        * @return string
         */
        function markNoConversion( $text, $noParse = false ) {
                return $text;
        }
 
+       /**
+        * @param $key string
+        * @return String
+        */
        function convertCategoryKey( $key ) {
                return $this->autoConvert( $key, 'zh' );
        }
@@ -110,13 +128,22 @@ class LanguageZh extends LanguageZh_hans {
                $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
        }
 
-       # this should give much better diff info
+       /**
+        * this should give much better diff info
+        *
+        * @param $text string
+        * @return string
+        */
        function segmentForDiff( $text ) {
                return preg_replace(
                        "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                        "' ' .\"$1\"", $text );
        }
 
+       /**
+        * @param $text string
+        * @return string
+        */
        function unsegmentForDiff( $text ) {
                return preg_replace(
                        "/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
@@ -145,6 +172,10 @@ class LanguageZh extends LanguageZh_hans {
 
        }
 
+       /**
+        * @param $termsArray array
+        * @return array
+        */
        function convertForSearchResult( $termsArray ) {
                $terms = implode( '|', $termsArray );
                $terms = self::convertDoubleWidth( $terms );