MediaWiki
REL1_19
|
Client for querying zhdaemon. More...
Public Member Functions | |
__construct ($host, $port) | |
Constructor. | |
close () | |
Close the connection. | |
connect () | |
Establish conncetion. | |
convert ($text, $tolang) | |
Convert the input to a different language variant. | |
convertToAllVariants ($text) | |
Convert the input to all possible variants. | |
isconnected () | |
Check if connection to zhdaemon is successful. | |
query ($request) | |
Query the daemon and return the result. | |
segment ($text) | |
Perform word segmentation. | |
Public Attributes | |
$mConnected | |
$mFP | |
$mHost | |
$mPort |
Client for querying zhdaemon.
Definition at line 6 of file ZhClient.php.
ZhClient::__construct | ( | $ | host, |
$ | port | ||
) |
Constructor.
$host | |
$port |
Definition at line 17 of file ZhClient.php.
References connect().
ZhClient::close | ( | ) |
Close the connection.
Definition at line 141 of file ZhClient.php.
Establish conncetion.
Definition at line 39 of file ZhClient.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by __construct().
ZhClient::convert | ( | $ | text, |
$ | tolang | ||
) |
Convert the input to a different language variant.
$text | String: input text |
$tolang | String: language variant |
Definition at line 87 of file ZhClient.php.
References $result, and query().
ZhClient::convertToAllVariants | ( | $ | text | ) |
Convert the input to all possible variants.
$text | String: input text |
Definition at line 103 of file ZhClient.php.
References $result, and query().
Check if connection to zhdaemon is successful.
Definition at line 28 of file ZhClient.php.
ZhClient::query | ( | $ | request | ) |
Query the daemon and return the result.
Definition at line 54 of file ZhClient.php.
References $result, and print.
Referenced by convert(), convertToAllVariants(), and segment().
ZhClient::segment | ( | $ | text | ) |
Perform word segmentation.
$text | String: input text |
Definition at line 128 of file ZhClient.php.
References $result, and query().
ZhClient::$mConnected |
Definition at line 7 of file ZhClient.php.
ZhClient::$mFP |
Definition at line 7 of file ZhClient.php.
ZhClient::$mHost |
Definition at line 7 of file ZhClient.php.
ZhClient::$mPort |
Definition at line 7 of file ZhClient.php.