The Chinese word segmentation tool uses the word segmentation function of the Sina sae platform to develop simple word segmentation APIs for free! The Chinese word segmentation tool uses the word segmentation function of the Sina sae platform to develop simple word segmentation APIs for free!
Method
Http://5.tbip.sinaapp.com/api.php? Str = Sunday tomorrow & type = str
Parameter description
Str = Chinese string (Chinese character to be segmented)
Type = the serialized array is returned by default.
Str returns a string separated by commas (,), for example, tomorrow, Sunday.
Json return json results
Segment ($ str, 1); if ($ type = "str") {foreach ($ ret as $ v) {$ keyword [] = $ v ['word'];} print_r (implode (",", $ keyword);} else if ($ type = "json ") {print_r (json_encode ($ ret);} else {print_r (serialize ($ ret ));} // if ($ ret = false) var_dump ($ seg-> errno (), $ seg-> errmsg ();?>
The above is the content of the Chinese word segmentation API. For more information, see PHP Chinese network (www.php1.cn )!