From 32b323337855d94b4a1aebbdb15a1ee78a47165e Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Thu, 6 Aug 2026 17:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E8=80=83=E6=96=87=E7=8C=AE=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/ReferenceTypeClassifier.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/common/ReferenceTypeClassifier.php b/application/common/ReferenceTypeClassifier.php index 9367481a..9897a05e 100644 --- a/application/common/ReferenceTypeClassifier.php +++ b/application/common/ReferenceTypeClassifier.php @@ -143,7 +143,11 @@ class ReferenceTypeClassifier $hasDoi = (bool)preg_match('/\bdoi:\s*10\./i', $text) || (bool)preg_match('#doi\.org/#i', $text); $hasUrl = (bool)preg_match('#https?://#i', $text); // 期刊卷期页结构,如 2020;382(8):727-733 或 2020;10:100 - $hasJournalVol = (bool)preg_match('/\b(19|20)\d{2}\s*[;:]\s*\d+\s*(\(\d+\))?\s*:\s*[A-Za-z]?\d+/', $text); + // 年份与卷号之间容忍多余标点与全角符号(作者原文常见 "2026;, 44(5): 24-31") + $hasJournalVol = (bool)preg_match( + '/\b(19|20)\d{2}[\s;:,,;:]+\d+\s*(\(\s*[^)]{1,12}\))?\s*[::]\s*[A-Za-z]?\d+/u', + $text + ); // 1) 学位论文 if (preg_match('/\[(ph\.?d\.?|master(\'s)?|doctoral|masters)?\s*(thesis|dissertation)\]/i', $text) @@ -161,11 +165,13 @@ class ReferenceTypeClassifier } // 3) 网页 / 在线资源 - if (preg_match('/\[(internet|online)\]/i', $text) + // "Available at:"/"Accessed" 同样出现在带 DOI 的期刊著录里(本系统自己的输出就带这个后缀), + // 故这些短语只在既无 DOI 也无卷期页结构时才作为网页依据 + $hasWebPhrase = preg_match('/\[(internet|online)\]/i', $text) || preg_match('/\baccessed\b/i', $text) || preg_match('/\bavailable\s+(from|at)\b/i', $text) - || preg_match('/\bcited\s+(19|20)\d{2}/i', $text) - || ($hasUrl && !$hasDoi && !$hasJournalVol)) { + || preg_match('/\bcited\s+(19|20)\d{2}/i', $text); + if (($hasWebPhrase || $hasUrl) && !$hasDoi && !$hasJournalVol) { return ['type' => self::TYPE_WEB, 'confidence' => 0.8]; }