Kaynağa Gözat

turbo split 逻辑优化

Bhikkhu-Kosalla 5 yıl önce
ebeveyn
işleme
9008c69bfc
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      app/dict/comp_csv.php

+ 3 - 1
app/dict/comp_csv.php

@@ -58,14 +58,16 @@ while($word = $redis->hGet("pali://wordindex.hash",$start))
 
         foreach ($arrword as $oneword) {
 			$result = array(); //全局变量,递归程序的输出容器
+			$min_result = 1;
 			if(mb_strlen($oneword)>35){
 				mySplit2($oneword, 0, true, 0.8, 0.9, 0, true, false);
 			}
 			else{
 				mySplit2($oneword, 0, false, 0.8, 0.9, 0, true, false);
+				$min_result=3;
 			}
 			
-			if(count($result)<3){
+			if(count($result)<$min_result){
 				mySplit2($oneword, 0, false, 0.2, 0.8, 0, true, true);
 				if (isset($_POST["debug"])) {
 					echo "正切:" . count($result) . "\n";