示例#1
0
文件: psearch.php 项目: xurenlu/tik
/**
从分词接口中分词
$keyword :语句
$start:偏移起始量
$end:偏移结束值
*/
function psearch_seg($keyword)
{
    /**
        $memcache=get_memcache();
        $key="psearch.seg.$keyword";
        if($data=get_memcache_data($memcache,$key)){
            return $data;
        }
    */
    global $rpc_client;
    if (empty($rpc_client)) {
        $rpc_client = new PHPRPC_Client();
        $rpc_client->setProxy(NULL);
        $rpc_client->useService(SCH_API);
    }
    $ret = $rpc_client->cnseg($keyword);
    //set_memcache_data($memcache,$key,$ret,4*3600);
    return $ret;
}