X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FZhClient.php;h=61faa8df716efe451cfcf725a8735d11906d70ef;hb=b020bc34caea44beaf5c83e8e45fb1232e695143;hp=0451ce8143ebb09b85c1f9938d9477cbc822faf8;hpb=74e1db122f5b461f6a02e0c6e88582c5c8e2c1a4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ZhClient.php b/includes/ZhClient.php index 0451ce8143..61faa8df71 100644 --- a/includes/ZhClient.php +++ b/includes/ZhClient.php @@ -1,12 +1,8 @@ mConnected; @@ -38,6 +32,7 @@ class ZhClient { */ function connect() { wfSuppressWarnings(); + $errno = $errstr = ''; $this->mFP = fsockopen($this->mHost, $this->mPort, $errno, $errstr, 30); wfRestoreWarnings(); if(!$this->mFP) { @@ -81,10 +76,9 @@ class ZhClient { /** * Convert the input to a different language variant * - * @param string $text input text - * @param string $tolang language variant + * @param $text string: input text + * @param $tolang string: language variant * @return string the converted text - * @access public */ function convert($text, $tolang) { $len = strlen($text); @@ -98,9 +92,8 @@ class ZhClient { /** * Convert the input to all possible variants * - * @param string $text input text + * @param $text string: input text * @return array langcode => converted_string - * @access public */ function convertToAllVariants($text) { $len = strlen($text); @@ -115,7 +108,6 @@ class ZhClient { foreach($info as $variant) { list($code, $len) = explode(' ', $variant); $ret[strtolower($code)] = substr($data, $i, $len); - $r = $ret[strtolower($code)]; $i+=$len; } return $ret; @@ -123,9 +115,8 @@ class ZhClient { /** * Perform word segmentation * - * @param string $text input text + * @param $text string: input text * @return string segmented text - * @access public */ function segment($text) { $len = strlen($text); @@ -139,11 +130,8 @@ class ZhClient { /** * Close the connection - * - * @access public */ function close() { fclose($this->mFP); } } -?> \ No newline at end of file