MediaWiki  REL1_22
ZhClient Class Reference

Client for querying zhdaemon. More...

List of all members.

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

Detailed Description

Client for querying zhdaemon.

Definition at line 26 of file ZhClient.php.


Constructor & Destructor Documentation

ZhClient::__construct ( host,
port 
)

Constructor.

Parameters:
$host
$port
Returns:
ZhClient

Definition at line 37 of file ZhClient.php.

References connect().


Member Function Documentation

Close the connection.

Definition at line 161 of file ZhClient.php.

Establish connection.

Access:
private
Returns:
bool

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.

Parameters:
string$textinput text
string$tolanglanguage variant
Returns:
string the converted text

Definition at line 107 of file ZhClient.php.

References $result, and query().

Convert the input to all possible variants.

Parameters:
string$textinput text
Returns:
array langcode => converted_string

Definition at line 123 of file ZhClient.php.

References $result, $ret, array(), as, list, and query().

Check if connection to zhdaemon is successful.

Returns:
bool

Definition at line 48 of file ZhClient.php.

ZhClient::query ( request)

Query the daemon and return the result.

Access:
private
Returns:
string

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.

Parameters:
string$textinput text
Returns:
string segmented text

Definition at line 148 of file ZhClient.php.

References $result, and query().


Member Data Documentation

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.


The documentation for this class was generated from the following file: