<commit_before><?php
/**
 * 核心基类，所有的回复的都必须加载的类。
 * @version 1.0.0
 * @author homker
 *
 */
//require_once dirname(dirname(__FILE__)) .'/common/Common.php';
require_once dirname(dirname(__FILE__)) .'/common/Define.php';
require_once dirname(dirname(__FILE__)) .'/common/GlobalFunctions.php';
require_once dirname(dirname(__FILE__)) .'/common/DbFactory.php';
require_once dirname(__FILE__) .'/PicArc.php';
require_once dirname(__FILE__) .'/model/rxl.php';
require_once dirname(__FILE__) .'/model/predis-0.8/autoload.php';

class WeChatCallBack {
	protected $_postObject;
	protected $_fromUserName;
	protected $_toUserName;
	protected $_createTime;
	protected $_msgType;
	protected $_msgId;
	protected $_event;
	protected $_EventKey;
	protected $_Recognition;
	protected $_time;
	
    public function getToUserName() {
    	return $this->_toUserName;
    }
    
    protected  function makeHint($hint) {
    	$resultStr = sprintf ( HINT_TPL, $this->_fromUserName, $this->_toUserName, $this->_time, 'text', $hint );
		return $resultStr;
    }
    /**
    *@desc 用来封装图文信息
    *@param (int) $hint (array) $hint = array( '1' =>array('title'=>$title ,'describle'=>$desc ,'picurl'=>$picurl ,'url'=>$url),'2' =>arry(……) );
    *@return (string) $resultStr
    */
    protected function makePic($hint){
    	$resultHead = sprintf( SUCC_TPL_head, $this->_fromUserName, $this->_toUserName, $this->_time,'news', count($hint) );
    	foreach($hint as $key => $value){
    		$resultBody = $resultBody . sprintf( SUCC_TPL_body, $value['title'], $value['describle'] , $value['picurl'], $value['url'] );
    	}
    	return $resultStr = $resultHead.$resultBody.SUCC_TPL_footer;
    }
     /**
    *@desc 用来封装音乐信息
    *@param 
    *@return (string) $resultStr<commit_msg>fix return null<commit_after><?php
/**
 * 核心基类，所有的回复的都必须加载的类。
 * @version 1.0.0
 * @author homker
 *
 */
//require_once dirname(dirname(__FILE__)) .'/common/Common.php';
require_once dirname(dirname(__FILE__)) .'/common/Define.php';
require_once dirname(dirname(__FILE__)) .'/common/GlobalFunctions.php';
require_once dirname(dirname(__FILE__)) .'/common/DbFactory.php';
require_once dirname(__FILE__) .'/PicArc.php';
require_once dirname(__FILE__) .'/model/rxl.php';
require_once dirname(__FILE__) .'/model/predis-0.8/autoload.php';

class WeChatCallBack {
	protected $_postObject;
	protected $_fromUserName;
	protected $_toUserName;
	protected $_createTime;
	protected $_msgType;
	protected $_msgId;
	protected $_event;
	protected $_EventKey;
	protected $_Recognition;
	protected $_time;
	
    public function getToUserName() {
    	return $this->_toUserName;
    }
    
    protected  function makeHint($hint) {
    	if($hint != ""){
	$resultStr = sprintf ( HINT_TPL, $this->_fromUserName, $this->_toUserName, $this->_time, 'text', $hint );
		return $resultStr;
	}else{
		return null;
	}
    }
    /**
    *@desc 用来封装图文信息
    *@param (int) $hint (array) $hint = array( '1' =>array('title'=>$title ,'describle'=>$desc ,'picurl'=>$picurl ,'url'=>$url),'2' =>arry(……) );
    *@return (string) $resultStr
    */
    protected function makePic($hint){
    	$resultHead = sprintf( SUCC_TPL_head, $this->_fromUserName, $this->_toUserName, $this->_time,'news', count($hint) );
    	foreach($hint as $key => $value){
    		$resultBody = $resultBody . sprintf( SUCC_TPL_body, $value['title'], $value['describle'] , $value['picurl'], $value['url'] );
    	}
    	return $resultStr = $resultHead.$resultBody.SUCC_TPL_footer;
    }
     /**
    *@desc 用来封装音乐信息
    *@param 
    *@return (string) $resultStr
{'fraction_non_alphanumeric': 0.17428087986463622, 'fraction_numerical': 0.003948110547095319, 'mean_word_length': 4.482225656877898, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1346907', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1305, 'n_words': 235}