<commit_before><?php
	require 'LIB_http.php';
	class analytic {
		public function __construct($name) {
			$this -> name = $name;
		}
		
		private function parseFile($fileName) {
			if(!file_exists($fileName)) {
				$handle = false;
			}
			else {
				$handle = file_get_contents($fileName);
			}
			
			return $handle;
		}
		
		private function httpGet($url) {
			$data = http_get($url, $target = "");
			$data = $data["FILE"];
			$data = json_decode($data, true);
			return $data;
		}
		
		private function processStr($colleges, $data) {
			if($this -> name === "university") {
				$search = array("台", "表特大學", "文化大學", "美和大學", "臺北城市大學", "新生醫護管理學校", "美和護專",
					"元培科技大學", "醒悟科技大學", "德明", "耕莘", "華夏大學", "臺北商業技術學院", "輔英大學");
				$replace = array("臺", "", "中國文化大學", "美和科技大學", "臺北城市科技大學", "新生醫護管理專科學校",
					"美和科技大學", "元培醫事科技大學", "醒吾科技大學", "德明財經科技大學", "耕莘健康管理專科學校", "華夏科技大學",
					"國立臺北商業大學", "輔英科技大學");
 
				for($i=0;$i<count($data);$i++) {
					$message = trim($data[$i]["message"]);
					$message = str_replace($search, $replace, $message);
		
					if(strpos($message, "科大") !== false) {
						$message = str_replace("科大", "科技大學", $message);
					}
					if(strpos($message, "專校") !== false) {
						$message = str_replace("專校", "專科學校", $message);
					}
			

					$count = 0;
					for($j=0;$j<count($colleges);$j++) {
						//ignore china university
						if(strpos($message, "中國傳媒大學") !== false)
							continue;
						if(strpos($message, $colleges[$j]["name"]) !== false) {
							$colleges[$j]["count"] += 1;
							break;
						}
					}
				}
			}
			
			$result = 0;
			if($this -> name === "FJU") {
				for($i=0;$i<count($data);$i++) {
					$check = true;
					$message = trim($data[$i]["message"], "系");
					for($j=0;$j<count($colleges);$j++) {
						if(stristr($message, $colleges[$j]["name"]) !== false) {
							$colleges[$j]["count"] += 1;
							$result += 1;
							$check = false;
							break;
						}
					}
					<commit_msg>change trim to str_replace : 系<commit_after><?php
	require 'LIB_http.php';
	class analytic {
		public function __construct($name) {
			$this -> name = $name;
		}
		
		private function parseFile($fileName) {
			if(!file_exists($fileName)) {
				$handle = false;
			}
			else {
				$handle = file_get_contents($fileName);
			}
			
			return $handle;
		}
		
		private function httpGet($url) {
			$data = http_get($url, $target = "");
			$data = $data["FILE"];
			$data = json_decode($data, true);
			return $data;
		}
		
		private function processStr($colleges, $data) {
			if($this -> name === "university") {
				$search = array("台", "表特大學", "文化大學", "美和大學", "臺北城市大學", "新生醫護管理學校", "美和護專",
					"元培科技大學", "醒悟科技大學", "德明", "耕莘", "華夏大學", "臺北商業技術學院", "輔英大學");
				$replace = array("臺", "", "中國文化大學", "美和科技大學", "臺北城市科技大學", "新生醫護管理專科學校",
					"美和科技大學", "元培醫事科技大學", "醒吾科技大學", "德明財經科技大學", "耕莘健康管理專科學校", "華夏科技大學",
					"國立臺北商業大學", "輔英科技大學");
 
				for($i=0;$i<count($data);$i++) {
					$message = trim($data[$i]["message"]);
					$message = str_replace($search, $replace, $message);
		
					if(strpos($message, "科大") !== false) {
						$message = str_replace("科大", "科技大學", $message);
					}
					if(strpos($message, "專校") !== false) {
						$message = str_replace("專校", "專科學校", $message);
					}
			

					$count = 0;
					for($j=0;$j<count($colleges);$j++) {
						//ignore china university
						if(strpos($message, "中國傳媒大學") !== false)
							continue;
						if(strpos($message, $colleges[$j]["name"]) !== false) {
							$colleges[$j]["count"] += 1;
							break;
						}
					}
				}
			}
			
			$result = 0;
			if($this -> name === "FJU") {
				for($i=0;$i<count($data);$i++) {
					$check = true;
					$message = trim($data[$i]["message"]);
					$message = str_replace("系", "", $message);
					
					for($j=0;$j<count($colleges);$j++) {
						if(stristr($message, $colleges[$j]["name"]) !== false) {
							$colleges[$j]["count"] += 1;
							$result += 1;
							$check = false;
							break;
						}
					}
					
{'fraction_non_alphanumeric': 0.22773279352226722, 'fraction_numerical': 0.004554655870445344, 'mean_word_length': 2.9177403369672943, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '479224', 'n_tokens_mistral': 2246, 'n_tokens_neox': 1919, 'n_words': 266}