fengweiqiang 5 năm trước cách đây
mục cha
commit
1279fd25a4
2 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 2 2
      src/jy/extract/extract.go
  2. 3 1
      src/jy/extract/score_jsondata.go

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

@@ -2088,11 +2088,11 @@ func funcAnalysis(j *ju.Job, e *ExtractTask) (*map[string]interface{}, map[strin
 		ju.Sort(val)
 	}
 	if !(len(j.Result) <= 0 || j.Jsondata == nil || len(*j.Jsondata) <= 0) {
+		//jsondata清理
+		clearJd(j.Jsondata,e)
 		marshalbt, _ := json.Marshal(j.Jsondata)
 		tmpjddata := make(map[string]interface{})
 		json.Unmarshal(marshalbt,&tmpjddata)
-		//jsondata清理
-		clearJd(j.Jsondata,e)
 		for _, jdkey := range ju.JsonData {
 			if (*j.Jsondata)[jdkey] != nil && (*j.Jsondata)[jdkey] != "" && len(j.Result[jdkey]) >= 5 {
 				for tmpk, tmpv := range j.Result[jdkey][:5] {

+ 3 - 1
src/jy/extract/score_jsondata.go

@@ -15,7 +15,7 @@ import (
 var htmlclrear = regexp.MustCompile("</?[^>]+>")
 
 //清理括号结尾
-var endOfParenthesesClrear = regexp.MustCompile(`[\(\[(【\{]+[\\u4e00-\\u9fa5\s]*[\))\]】\}]+$`)
+var endOfParenthesesClrear = regexp.MustCompile(`[\\(\\[(【\\{]+[\\u4e00-\\u9fa5\s]*[\\))\\]】\\}]+$`)
 
 //清理标点符合结尾
 var endOfPunctuationClrear = regexp.MustCompile("[,,.。??;;]+$")
@@ -58,6 +58,8 @@ func clearJd(jd *map[string]interface{}, e *ExtractTask) {
 			} else {
 				(*jd)[k] = vstring
 			}
+		}else if k == "Detail"{
+			delete(*jd, k)
 		}
 	}
 }