MediaWiki
REL1_22
|
Client for querying zhdaemon. More...
Public Member Functions | |
__construct ($host, $port) | |
Constructor. | |
close () | |
Close the connection. | |
connect () | |
Establish connection. | |
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 26 of file ZhClient.php.
ZhClient::__construct | ( | $ | host, |
$ | port | ||
) |
Constructor.
$host | |
$port |
Definition at line 37 of file ZhClient.php.
References connect().
ZhClient::close | ( | ) |
Close the connection.
Definition at line 161 of file ZhClient.php.
Establish connection.
Definition at line 59 of file ZhClient.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by __construct().
ZhClient::convert | ( | $ | text, |
$ | tolang | ||
) |
Convert the input to a different language variant.
string | $text | input text |
string | $tolang | language variant |
Definition at line 107 of file ZhClient.php.
ZhClient::convertToAllVariants | ( | $ | text | ) |
Check if connection to zhdaemon is successful.
Definition at line 48 of file ZhClient.php.
ZhClient::query | ( | $ | request | ) |
Query the daemon and return the result.
Definition at line 74 of file ZhClient.php.
References $result, list, and print.
Referenced by convert(), convertToAllVariants(), and segment().
ZhClient::segment | ( | $ | text | ) |
Perform word segmentation.
string | $text | input text |
Definition at line 148 of file ZhClient.php.
ZhClient::$mConnected |
Definition at line 27 of file ZhClient.php.
ZhClient::$mFP |
Definition at line 27 of file ZhClient.php.
ZhClient::$mHost |
Definition at line 27 of file ZhClient.php.
ZhClient::$mPort |
Definition at line 27 of file ZhClient.php.