فهرست منبع

提取单词的时候判断长度

visuddhinanda 1 سال پیش
والد
کامیت
82a7b62b48
1فایلهای تغییر یافته به همراه2 افزوده شده و 5 حذف شده
  1. 2 5
      api-v8/app/Console/Commands/UpgradeCompound.php

+ 2 - 5
api-v8/app/Console/Commands/UpgradeCompound.php

@@ -149,7 +149,8 @@ class UpgradeCompound extends Command
                 $to = $max;
             }
             $words = WordIndex::whereBetween('id', [$from, $to])
-                ->where('len', '>', $this->option('min'))
+                ->where('len', '>=', $this->option('min'))
+                ->where('len', '<=', $this->option('max'))
                 ->orderBy('id')
                 ->selectRaw('id,word as real')
                 ->cursor();
@@ -224,10 +225,6 @@ class UpgradeCompound extends Command
                 }
             }
             if (count($parts) === 0) {
-                if (mb_strlen($word->real, 'UTF-8') > $this->option('max')) {
-                    Log::error('超长,give up' . $word->real);
-                    continue;
-                }
                 $ts = new TurboSplit();
                 if ($this->option('debug')) {
                     $ts->debug(true);