|
@@ -5198,7 +5198,7 @@ class DistrictPredictor():
|
|
|
return ''
|
|
|
|
|
|
def get_project_addr(text):
|
|
|
- p1 = '(项目(施工|实施)?|建设|工程|服务|交货|送货|收货)(地址|地点|位置|所在地区?):(\w{2,8}[省市州区县][^\w]*)+'
|
|
|
+ p1 = '(项目(施工|实施)?|建设|工程|服务|交货|送货|收货|展示|看样|拍卖)(地址|地点|位置|所在地区?):(\w{2,8}[省市州区县][^\w]*)+'
|
|
|
if re.search(p1, text):
|
|
|
return re.search(p1, text).group(0)
|
|
|
else:
|
|
@@ -5271,6 +5271,16 @@ class DistrictPredictor():
|
|
|
|
|
|
web_source_name = str(web_source_name) # 修复某些不是字符串类型造成报错
|
|
|
text1 = re.sub('复合肥|铁路|公路|新会计', ' ', text1) #预防提取错 合肥 路南 新会 等地区
|
|
|
+
|
|
|
+ if pro_addr:
|
|
|
+ msc += '## 使用项目地址输入:%s ##;' % pro_addr
|
|
|
+ rs = get_area(pro_addr, '')
|
|
|
+ msc += '预测结果:省份:%s, 城市:%s,区县:%s;' % (
|
|
|
+ rs['district']['province'], rs['district']['city'], rs['district']['district'])
|
|
|
+ if rs['district']['province'] != '全国':
|
|
|
+ # print('地区匹配:', msc)
|
|
|
+ return rs
|
|
|
+
|
|
|
# print('text1:', text1)
|
|
|
msc += '## 第一次预测输入:%s ##;'%text1
|
|
|
rs = get_area(text1, web_source_name)
|