瀏覽代碼

5d423448a5cb26b9b753ada7 优化

fengweiqiang 6 年之前
父節點
當前提交
6771e203e4
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 5 5
      src/jy/pretreated/tablev2.go
  2. 1 1
      src/res/fieldscore.json

+ 5 - 5
src/jy/pretreated/tablev2.go

@@ -140,7 +140,7 @@ func NewTD(Goquery *goquery.Selection, tr *TR, table *Table) *TD {
 		for _, bl := range ub {
 			//冒号kv
 			for bl_ck, bl_cv := range bl.ColonKV.Kv {
-				if td.SortKV.Map[bl_ck] == nil || bl.ColonKV.KvTag[bl_ck].Weight >= td.SortKVWeight[bl_ck] {
+				if bl_cv != "" && (td.SortKV.Map[bl_ck] == nil || bl.ColonKV.KvTag[bl_ck].Weight >= td.SortKVWeight[bl_ck]) {
 					td.SortKV.AddKey(bl_ck, bl_cv)
 					td.SortKVWeight[bl_ck] = bl.ColonKV.KvTag[bl_ck].Weight
 				}
@@ -235,12 +235,12 @@ func (td *TD) tdHasTable(bsontable *bool, tr *TR) {
 					if td.TR.Table.TableResult == nil {
 						td.TR.Table.TableResult = NewTableResult(sonts.Id, sonts.Toptype, sonts.BlockTag, sonts.Html, sonts.Itype, sonts.RuleBlock)
 					}
-					if td.TR.Table.TableResult.SortKVWeight[k] < sonts.SortKVWeight[k]{
+					if td.TR.Table.TableResult.SortKVWeight[k] < sonts.SortKVWeight[k] {
 						td.TR.Table.TableResult.SortKV.AddKey(k, v)
 						td.TR.Table.TableResult.SortKVWeight[k] = sonts.SortKVWeight[k]
-					}else {
-						td.SortKV.AddKey(k,v)
-						td.SortKVWeight[k]=sonts.SortKVWeight[k]
+					} else {
+						td.SortKV.AddKey(k, v)
+						td.SortKVWeight[k] = sonts.SortKVWeight[k]
 					}
 				}
 				td.SonTableResult = sonts

+ 1 - 1
src/res/fieldscore.json

@@ -315,7 +315,7 @@
             },
             {
                 "describe": "包含负分",
-                "regstr": "(勘察|设计|设备|项目|标段|工程|监理|范围|分包|月|日|天|[,,。、::“”‘’_\"])",
+                "regstr": "(null|勘察|设计|设备|项目|标段|工程|监理|范围|分包|月|日|天|[,,。、::“”‘’_\"])",
                 "score": -1
             },
             {