Browse Source

非复合词才计算parent

visuddhinanda 2 years ago
parent
commit
5e1197179a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/Http/Controllers/WbwLookupController.php

+ 3 - 1
app/Http/Controllers/WbwLookupController.php

@@ -213,7 +213,9 @@ class WbwLookupController extends Controller
                         $increment = 1;
                         $increment = 1;
                     }
                     }
                     //将全部结果加上得分放入数组
                     //将全部结果加上得分放入数组
-                    $parent = $this->insertValue([$value->parent],$parent,$increment);
+                    if($value->type!=='.cp.'){
+                        $parent = $this->insertValue([$value->parent],$parent,$increment);
+                    }
 
 
                     if(!empty($value->type) && $value->type !== ".cp."){
                     if(!empty($value->type) && $value->type !== ".cp."){
                         $case = $this->insertValue([$value->type."#".$value->grammar],$case,$increment);
                         $case = $this->insertValue([$value->type."#".$value->grammar],$case,$increment);