maxiaoshan 5 years ago
parent
commit
d3a29ec136
2 changed files with 8 additions and 3 deletions
  1. 7 2
      src/jy/extract/newextractcity.go
  2. 1 1
      src/main_test.go

+ 7 - 2
src/jy/extract/newextractcity.go

@@ -440,6 +440,7 @@ func (e *ExtractTask) NewGetCityByOthers(j *ju.Job, sm *SortMap, pscore, cscore,
 								break
 							} else if p_full == tmpPbrief {
 								c_full = cfMap.Name
+								PCDScore(j, "province", tmpPbrief, 4+ts, true) //
 								PCDScore(j, "city", c_full, 4+ts, true)
 								break
 							} else if p_full != "" && p_full != tmpPbrief {
@@ -458,6 +459,7 @@ func (e *ExtractTask) NewGetCityByOthers(j *ju.Job, sm *SortMap, pscore, cscore,
 								if c_full == "" {
 									c_full = c.Name
 									PCDScore(j, "city", c_full, 4+ts, true)
+									PCDScore(j, "province", tmpPbrief, 4+ts, true) //
 								}
 								isOk = true
 								districtOk = true
@@ -532,10 +534,12 @@ func (e *ExtractTask) NewGetCityByOthers(j *ju.Job, sm *SortMap, pscore, cscore,
 							} else if p_sim == tmpPbrief {
 								c_sim = cbMap.Brief
 								PCDScore(j, "city", cbMap.Name, 3+ts, false)
+								PCDScore(j, "province", tmpPbrief, 3+ts, false)
 								break
 							} else if p_sim != "" && p_sim != tmpPbrief { //上海宝冶集团有限公司南京分公司 北京朝阳中西医结合急诊抢救中心
 								delete(j.SimAreaScore, p_sim)
-								p_sim = text
+								c_sim = text      //
+								p_sim = tmpPbrief //
 								PCDScore(j, "province", tmpPbrief, 3+ts, false)
 								PCDScore(j, "city", cbMap.Name, 3+ts, false)
 							}
@@ -547,13 +551,14 @@ func (e *ExtractTask) NewGetCityByOthers(j *ju.Job, sm *SortMap, pscore, cscore,
 						for _, dfull_city := range dfull_citys {
 							for dfull, c := range dfull_city { //dfull:简称对应的全称
 								tmpPbrief := c.P.Brief
-								if p_sim == tmpPbrief || p_full == tmpPbrief { //省份一致
+								if p_sim == tmpPbrief { //省份一致
 									d_sim = text
 									PCDScore(j, "district", dfull, 2+ts, false)
 									if c_sim == "" {
 										c_sim = c.Brief
 										PCDScore(j, "city", c.Name, 2+ts, false)
 									}
+									PCDScore(j, "province", tmpPbrief, 2+ts, false) //
 								} else if p_sim == "" {
 									if !repeatDb[dfull] {
 										PCDScoreByDistrictSim("d", dfull, 1+ts, pscore, cscore, dscore)

+ 1 - 1
src/main_test.go

@@ -28,7 +28,7 @@ func Test_han(t *testing.T) {
 func Test_task(t *testing.T) {
 	Mgo = MgoFactory(1, 3, 120, "192.168.3.207:27082", "extract_kf")
 	//extract.StartExtractTaskId("5b8f804025e29a290415aee1")5c528686698414055c47b115
-	extract.StartExtractTestTask("5cdd3025698414032c8322b1", "5d2bcde8a5cb26b9b7551802", "1", "mxs_v1", "mxs_v1")
+	extract.StartExtractTestTask("5cdd3025698414032c8322b1", "58369e4161a0721f1583247a", "1", "mxs_v1", "mxs_v1")
 	//extract.StartExtractTestTask("5c3d75c96984142998eb00e1", "5c2a3d28a5cb26b9b76144dd", "100", "mxs_v3", "mxs_v3")
 	time.Sleep(5 * time.Second)
 }