MediaWiki  REL1_19
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 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

Detailed Description

Client for querying zhdaemon.

Definition at line 6 of file ZhClient.php.


Constructor & Destructor Documentation

ZhClient::__construct ( host,
port 
)

Constructor.

Parameters:
$host
$port
Returns:
ZhClient

Definition at line 17 of file ZhClient.php.

References connect().

Here is the call graph for this function:


Member Function Documentation

Close the connection.

Definition at line 141 of file ZhClient.php.

Establish conncetion.

Access:
private
Returns:
bool

Definition at line 39 of file ZhClient.php.

References wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

ZhClient::convert ( text,
tolang 
)

Convert the input to a different language variant.

Parameters:
$textString: input text
$tolangString: language variant
Returns:
string the converted text

Definition at line 87 of file ZhClient.php.

References $result, and query().

Here is the call graph for this function:

Convert the input to all possible variants.

Parameters:
$textString: input text
Returns:
array langcode => converted_string

Definition at line 103 of file ZhClient.php.

References $result, and query().

Here is the call graph for this function:

Check if connection to zhdaemon is successful.

Returns:
bool

Definition at line 28 of file ZhClient.php.

ZhClient::query ( request)

Query the daemon and return the result.

Access:
private
Returns:
string

Definition at line 54 of file ZhClient.php.

References $result, and print.

Referenced by convert(), convertToAllVariants(), and segment().

Here is the caller graph for this function:

ZhClient::segment ( text)

Perform word segmentation.

Parameters:
$textString: input text
Returns:
string segmented text

Definition at line 128 of file ZhClient.php.

References $result, and query().

Here is the call graph for this function:


Member Data Documentation

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.


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