<commit_before><?php
	/**
	 * select返回的数组进行整数映射转换
	 *
	 * @param array $map  映射关系二维数组  array(
	 *                                          '字段名1'=>array(映射关系数组),
	 *                                          '字段名2'=>array(映射关系数组),
	 *                                           ......
	 *                                       )
	 * @author 朱亚杰 <<EMAIL>>
	 * @return array
	 *
	 *  array(
	 *      array('id'=>1,'title'=>'标题','status'=>'1','status_text'=>'正常')
	 *      ....
	 *  )
	 *
	 */
function col_to_string(&$data,$map=array(
										'status'=>array(1=>'正常',-1=>'已删',0=>'禁用'),
										'reply_type'=>array('text'=>'文本','news'=>'分类','document'=>'文章','music'=>'音乐','special','专属'),
										'segment'=>array('events'=>'事件','costom'=>'自定义','activity'=>'活动','activity_ticket'=>'优惠券')
										)) {
	    if($data === false || $data === null ){
	        return $data;
	    }
	    $data = (array)$data;
	    foreach ($data as $key => $row){
	        foreach ($map as $col=>$pair){
	            if(isset($row[$col]) && isset($pair[$row[$col]])){
	                $data[$key][$col.'_text'] = $pair[$row[$col]];
	            }
	        }
	    }
	    return $data;
	}
	
	/**
	 * 去除数组中空值键位函数
	 */
	function arr_no_empty($arr) {
    if (is_array($arr)) {
        foreach ( $arr as $k => $v ) {
            if (empty($v)) unset($arr[$k]);
            elseif (is_array($v)) {
                $arr[$k] = arr_no_empty($v);
            }
        }
    }
    return $arr;<commit_msg>edit an function col_to_string()<commit_after><?php
	/**
	 * select返回的数组进行整数映射转换
	 *
	 * @param array $map  映射关系二维数组  array(
	 *                                          '字段名1'=>array(映射关系数组),
	 *                                          '字段名2'=>array(映射关系数组),
	 *                                           ......
	 *                                       )
	 * @author 朱亚杰 <<EMAIL>>
	 * @return array
	 *
	 *  array(
	 *      array('id'=>1,'title'=>'标题','status'=>'1','status_text'=>'正常')
	 *      ....
	 *  )
	 *
	 */
function col_to_string(&$data,$map=array(
										'status'=>array(1=>'正常',-1=>'已删',0=>'禁用'),
										'reply_type'=>array('text'=>'文本','news'=>'分类','document'=>'文章','music'=>'音乐','special'=>'专属'),
										'segment'=>array('0'=>'自定义','6'=>'活动','7'=>'折扣','8'=>'优惠券')
										)) {
	    if($data === false || $data === null ){
	        return $data;
	    }
	    $data = (array)$data;
	    foreach ($data as $key => $row){
	        foreach ($map as $col=>$pair){
	            if(isset($row[$col]) && isset($pair[$row[$col]])){
	                $data[$key][$col.'_text'] = $pair[$row[$col]];
	            }
	        }
	    }
	    return $data;
	}
	
	/**
	 * 去除数组中空值键位函数
	 */
	function arr_no_empty($arr) {
    if (is_array($arr)) {
        foreach ( $arr as $k => $v ) {
            if (empty($v)) unset($arr[$k]);
            elseif (is_array($v)) {
                $arr[$k] = arr_no_empty($v);
            }
        }
    }
    return $arr;
{'fraction_non_alphanumeric': 0.2271024855294518, 'fraction_numerical': 0.006128702757916241, 'mean_word_length': 1.5862676056338028, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2118608', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1087, 'n_words': 128}