From 96f023f609156380d832e4321ab92cb4aa8ab4dc Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Tue, 30 Jun 2026 15:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A0=94=E5=AD=A6=E7=BA=BF=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Support/DocTextExtractor.php | 8 ++++++++ app/Support/StudyTourDeclarationParser.php | 23 ++++++++-------------- app/Support/StudyTourPayload.php | 1 + 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/Support/DocTextExtractor.php b/app/Support/DocTextExtractor.php index 1cc3e93..39cbb41 100644 --- a/app/Support/DocTextExtractor.php +++ b/app/Support/DocTextExtractor.php @@ -497,6 +497,14 @@ class DocTextExtractor return false; } + if (preg_match('/^[\d\s]+人$/u', $line)) { + return false; + } + + if (preg_match('/^[\d\-\—-–\s]+$/u', $line) && preg_match('/\d{3,}/', $line)) { + return false; + } + if (preg_match('/[\x{0080}-\x{009F}]/u', $line)) { return true; } diff --git a/app/Support/StudyTourDeclarationParser.php b/app/Support/StudyTourDeclarationParser.php index d117a38..9b361eb 100644 --- a/app/Support/StudyTourDeclarationParser.php +++ b/app/Support/StudyTourDeclarationParser.php @@ -517,21 +517,6 @@ class StudyTourDeclarationParser ]; } - foreach ($groups as &$group) { - $lastLocation = ''; - foreach ($group['items'] as &$item) { - if ($item['location'] !== '') { - $lastLocation = $item['location']; - continue; - } - if ($lastLocation !== '') { - $item['location'] = $lastLocation; - } - } - unset($item); - } - unset($group); - return StudyTourPayload::normalizeRoutePlans($groups); } @@ -897,6 +882,14 @@ class StudyTourDeclarationParser return false; } + if (preg_match('/^[\d\s]+人$/u', $line)) { + return false; + } + + if (preg_match('/^[\d\-\—-–\s]+$/u', $line) && preg_match('/\d{3,}/', $line)) { + return false; + } + if (self::isWordMetadataLine($line)) { return true; } diff --git a/app/Support/StudyTourPayload.php b/app/Support/StudyTourPayload.php index c3c3f28..f7fa05e 100644 --- a/app/Support/StudyTourPayload.php +++ b/app/Support/StudyTourPayload.php @@ -250,6 +250,7 @@ class StudyTourPayload public static function normalizeContactPhones(string $raw): string { + $raw = str_replace(['—', '-', '–'], '-', $raw); $raw = str_replace([',', ',', ';', ';', '/', '|'], '、', $raw); $parts = preg_split('/[、\s]+/u', $raw) ?: []; $parts = array_values(array_filter(array_map('trim', $parts), fn ($p) => $p !== ''));