From 9079f8d5d8b6f155c9ee84c3f3f071642edca47b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 12 Jul 2023 15:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90IP=E5=BA=93=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E8=87=AA=E5=8A=A8=E6=8C=87=E5=AE=9A=E7=9C=81=E7=95=A5?= =?UTF-8?q?=E7=9A=84=E5=9F=8E=E5=B8=82=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/iplibrary/template.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/iplibrary/template.go b/pkg/iplibrary/template.go index 01fae7a..c90f338 100644 --- a/pkg/iplibrary/template.go +++ b/pkg/iplibrary/template.go @@ -70,6 +70,11 @@ func (this *Template) Extract(text string, emptyValues []string) (values map[str } } + // 自动修复省略的城市名 + if len(values["city"]) == 0 && len(values["province"]) > 0 && len(values["town"]) > 0 { + values["city"] = values["province"] + } + ok = true return }