|
MediaWiki
REL1_20
|
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 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 conncetion.
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.
| $text | String: input text |
| $tolang | String: language variant |
Definition at line 107 of file ZhClient.php.
| ZhClient::convertToAllVariants | ( | $ | text | ) |
Convert the input to all possible variants.
| $text | String: input text |
Definition at line 123 of file ZhClient.php.
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, and print.
Referenced by convert(), convertToAllVariants(), and segment().
| ZhClient::segment | ( | $ | text | ) |
Perform word segmentation.
| $text | String: 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.