<?php
+/**
+ */
+
/**
* Client for querying zhdaemon
*
- * @package MediaWiki
*/
-
class ZhClient {
var $mHost, $mPort, $mFP, $mConnected;
*/
function connect() {
wfSuppressWarnings();
+ $errno = $errstr = '';
$this->mFP = fsockopen($this->mHost, $this->mPort, $errno, $errstr, 30);
wfRestoreWarnings();
if(!$this->mFP) {
}
/**
- * Convert the input to all possible variants
+ * Convert the input to all possible variants
*
* @param string $text input text
* @return array langcode => converted_string
* @access public
- */
+ */
function convertToAllVariants($text) {
$len = strlen($text);
$q = "CONV ALL $len\n$text";
foreach($info as $variant) {
list($code, $len) = explode(' ', $variant);
$ret[strtolower($code)] = substr($data, $i, $len);
- $r = $ret[strtolower($code)];
$i+=$len;
}
return $ret;
- }
+ }
/**
* Perform word segmentation
*
fclose($this->mFP);
}
}
-
-?>
\ No newline at end of file