Your Name 5 months ago
parent
commit
d56198b8ae
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      application/api/controller/Ai.php

+ 6
- 3
application/api/controller/Ai.php View File

442
         //13.判断是否合法 同时存在触发词和并发词
442
         //13.判断是否合法 同时存在触发词和并发词
443
         //增加判断可以不存在并发词和触发词
443
         //增加判断可以不存在并发词和触发词
444
         //只需要匹配 包含主词即可通过
444
         //只需要匹配 包含主词即可通过
445
-        if(!empty($data['cfc']) && (string)$data['cfc'] != '0'){
445
+        if(!empty($data['cfc']) && (string)$data['cfc'] != '0' || !empty($data['bfc']) && (string)$data['bfc'] != '0'){
446
             [$is_bh1,$fc1] = $this->isInRule($data['cfc'],$line);
446
             [$is_bh1,$fc1] = $this->isInRule($data['cfc'],$line);
447
             [$is_bh2,$fc2] = $this->isInRule($data['bfc'],$line);
447
             [$is_bh2,$fc2] = $this->isInRule($data['bfc'],$line);
448
         }else{
448
         }else{
452
 
452
 
453
         if($is_bh1 > 0 && $is_bh2 > 0){
453
         if($is_bh1 > 0 && $is_bh2 > 0){
454
             //同时存在
454
             //同时存在
455
-            $desc .= '同时存在并发词['.$fc2.']和触发词['.$fc1.']合法';
455
+            $desc .= '合法,同时存在并发词['.$fc2.']和触发词['.$fc1.']';
456
+            return [1,$desc,$data];
457
+        }else if($is_bh1 > 0 || $is_bh2 > 0){
458
+            $desc .= '合法,不同时存在并发词['.$fc2.']和触发词['.$fc1.']';
456
             return [1,$desc,$data];
459
             return [1,$desc,$data];
457
         }else{
460
         }else{
458
-            $desc .= '不同时存在并发词['.$fc2.']和触发词['.$fc1.'],不合法';
461
+            $desc .= '不合法,同时存在并发词['.$fc2.']和触发词['.$fc1.']';
459
             return [0,$desc,$data];
462
             return [0,$desc,$data];
460
         }
463
         }
461
     }
464
     }

Loading…
Cancel
Save