|
@@ -29,10 +29,10 @@ func JsonDataMergeProcessing(j *util.Job, e *ExtractTask) map[string][]*util.Ext
|
|
lockclear.Lock()
|
|
lockclear.Lock()
|
|
cfn := e.ClearFn[v]
|
|
cfn := e.ClearFn[v]
|
|
lockclear.Unlock()
|
|
lockclear.Unlock()
|
|
- newNum := clear.DoClearFn(cfn, []interface{}{util2.Float64All((*j.Jsondata)[v]), ""})
|
|
|
|
|
|
+ newNum := clear.DoClearFn(cfn, []interface{}{(*j.Jsondata)[v], ""})
|
|
if util2.IntAll(newNum[0]) != 0 {
|
|
if util2.IntAll(newNum[0]) != 0 {
|
|
extFields := make([]*util.ExtField, 0)
|
|
extFields := make([]*util.ExtField, 0)
|
|
- extFields = append(extFields, &util.ExtField{Code: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), Field: v, ExtFrom: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), SourceValue: (*j.Jsondata)[v], Value: newNum[0], Score: 0.1})
|
|
|
|
|
|
+ extFields = append(extFields, &util.ExtField{Code: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), Field: v, ExtFrom: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), SourceValue: (*j.Jsondata)[v], Value: newNum[0], Score: 0.1,IsTrue:newNum[len(newNum)-1].(bool)})
|
|
j.Result[v] = extFields
|
|
j.Result[v] = extFields
|
|
//AddExtLog("extract", j.SourceMid, nil, newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
//AddExtLog("extract", j.SourceMid, nil, newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
//AddExtLog("clear", j.SourceMid, (*j.Jsondata)[v], newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
//AddExtLog("clear", j.SourceMid, (*j.Jsondata)[v], newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
@@ -120,15 +120,26 @@ func JsonDataMergeProcessing(j *util.Job, e *ExtractTask) map[string][]*util.Ext
|
|
if jdextweight == 0 {
|
|
if jdextweight == 0 {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+ oneScore := j.Result[v][0].Score
|
|
if v == "budget" || v == "bidamount" {
|
|
if v == "budget" || v == "bidamount" {
|
|
lockclear.Lock()
|
|
lockclear.Lock()
|
|
cfn := e.ClearFn[v]
|
|
cfn := e.ClearFn[v]
|
|
lockclear.Unlock()
|
|
lockclear.Unlock()
|
|
- newNum := clear.DoClearFn(cfn, []interface{}{util2.Float64All((*j.Jsondata)[v]), ""})
|
|
|
|
|
|
+ newNum := clear.DoClearFn(cfn, []interface{}{(*j.Jsondata)[v], ""})
|
|
if util2.IntAll(newNum[0]) != 0 {
|
|
if util2.IntAll(newNum[0]) != 0 {
|
|
extFields := make([]*util.ExtField, 0)
|
|
extFields := make([]*util.ExtField, 0)
|
|
- extFields = append(extFields, &util.ExtField{Code: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), Field: v, ExtFrom: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), SourceValue: (*j.Jsondata)[v], Value: newNum[0], Score: 0.1})
|
|
|
|
- j.Result[v] = extFields
|
|
|
|
|
|
+ if jdextweight >1{
|
|
|
|
+ if oneScore < 0{
|
|
|
|
+ oneScore =0.1
|
|
|
|
+ }
|
|
|
|
+ extFields = append(extFields, &util.ExtField{Code: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), Field: v, ExtFrom: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), SourceValue: (*j.Jsondata)[v], Value: newNum[0], Score: oneScore+1,IsTrue:newNum[len(newNum)-1].(bool)})
|
|
|
|
+ }else {
|
|
|
|
+ if oneScore < 0{
|
|
|
|
+ oneScore =0.1
|
|
|
|
+ }
|
|
|
|
+ extFields = append(extFields, &util.ExtField{Code: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), Field: v, ExtFrom: "JsonData_" + v + "_" + fmt.Sprint(jdextweight), SourceValue: (*j.Jsondata)[v], Value: newNum[0], Score: oneScore,IsTrue:newNum[len(newNum)-1].(bool)})
|
|
|
|
+ }
|
|
|
|
+ j.Result[v] = append(j.Result[v], extFields...)
|
|
//AddExtLog("extract", j.SourceMid, nil, newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
//AddExtLog("extract", j.SourceMid, nil, newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
//AddExtLog("clear", j.SourceMid, (*j.Jsondata)[v], newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
//AddExtLog("clear", j.SourceMid, (*j.Jsondata)[v], newNum[0], &RegLuaInfo{ "JsonData_"+v, "", v, "", false, nil, nil}, e.TaskInfo) //抽取日志
|
|
}
|
|
}
|
|
@@ -137,7 +148,6 @@ func JsonDataMergeProcessing(j *util.Job, e *ExtractTask) map[string][]*util.Ext
|
|
|
|
|
|
if strings.Trim(util2.ObjToString(j.Result[v][0].Value), " ") != strings.Trim(util2.ObjToString((*j.Jsondata)[v]), " ") {
|
|
if strings.Trim(util2.ObjToString(j.Result[v][0].Value), " ") != strings.Trim(util2.ObjToString((*j.Jsondata)[v]), " ") {
|
|
tmp = append(tmp, j.Result[v][0])
|
|
tmp = append(tmp, j.Result[v][0])
|
|
- oneScore := j.Result[v][0].Score
|
|
|
|
if jdextweight == 2 {
|
|
if jdextweight == 2 {
|
|
oneScore += 2
|
|
oneScore += 2
|
|
}
|
|
}
|