ZhClient Class Reference

Client for querying zhdaemon. More...

List of all members.

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


Detailed Description

Client for querying zhdaemon.

Definition at line 7 of file ZhClient.php.


Member Function Documentation

ZhClient::close (  ) 

Close the connection.

Definition at line 134 of file ZhClient.php.

ZhClient::connect (  ) 

Establish conncetion.

Access:
private

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.

Parameters:
$text string: input text
$tolang string: language variant
Returns:
string the converted text

Definition at line 83 of file ZhClient.php.

References $result, $text, and query().

ZhClient::convertToAllVariants ( text  ) 

Convert the input to all possible variants.

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

Definition at line 98 of file ZhClient.php.

References $code, $i, $result, $text, and query().

ZhClient::isconnected (  ) 

Check if connection to zhdaemon is successful.

Definition at line 24 of file ZhClient.php.

ZhClient::query ( request  ) 

Query the daemon and return the result.

Access:
private

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.

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

Definition at line 121 of file ZhClient.php.

References $result, $text, and query().

ZhClient::ZhClient ( host,
port 
)

Constructor.

Access:
private

Definition at line 15 of file ZhClient.php.

References connect().


Member Data Documentation

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.


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

Generated on Sat Sep 5 02:08:51 2009 for MediaWiki by  doxygen 1.5.9