Public Member Functions | |
| ZhClient ($host, $port) | |
| Constructor. | |
| isconnected () | |
| Check if connection to zhdaemon is successful. | |
| connect () | |
| Establish conncetion. | |
| query ($request) | |
| Query the daemon and return the result. | |
| convert ($text, $tolang) | |
| Convert the input to a different language variant. | |
| convertToAllVariants ($text) | |
| Convert the input to all possible variants. | |
| segment ($text) | |
| Perform word segmentation. | |
| close () | |
| Close the connection. | |
Public Attributes | |
| $mHost | |
| $mPort | |
| $mFP | |
| $mConnected | |
Definition at line 7 of file ZhClient.php.
| ZhClient::close | ( | ) |
| ZhClient::connect | ( | ) |
Establish conncetion.
Definition at line 33 of file ZhClient.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by ZhClient().
| ZhClient::convert | ( | $ | text, | |
| $ | tolang | |||
| ) |
Convert the input to a different language variant.
| $text | string: input text | |
| $tolang | string: language variant |
Definition at line 83 of file ZhClient.php.
| ZhClient::convertToAllVariants | ( | $ | text | ) |
| ZhClient::isconnected | ( | ) |
| ZhClient::query | ( | $ | request | ) |
Query the daemon and return the result.
Definition at line 49 of file ZhClient.php.
References $result, $status, and print.
Referenced by convert(), convertToAllVariants(), and segment().
| ZhClient::segment | ( | $ | text | ) |
Perform word segmentation.
| $text | string: input text |
Definition at line 121 of file ZhClient.php.
| ZhClient::ZhClient | ( | $ | host, | |
| $ | port | |||
| ) |
| ZhClient::$mConnected |
Definition at line 8 of file ZhClient.php.
| ZhClient::$mFP |
Definition at line 8 of file ZhClient.php.
| ZhClient::$mHost |
Definition at line 8 of file ZhClient.php.
| ZhClient::$mPort |
Definition at line 8 of file ZhClient.php.
1.5.9