|
@@ -103,10 +103,9 @@ var (
|
|
|
MultipleValueSplitReg = regexp.MustCompile("[,,、\\s\u3000\u2003\u00a0]")
|
|
|
BuyerContacts = []string{"采购单位联系人", "采购单位联系电话", "采购单位联系地址"}
|
|
|
FilterSerial = regexp.MustCompile(".+[、..::,]")
|
|
|
- filterTableWror = regexp.MustCompile("班子成员")
|
|
|
underline = regexp.MustCompile("_+$")
|
|
|
iswinnertabletag = regexp.MustCompile("(中标|候选人|成交|结果)")
|
|
|
- nswinnertabletag = regexp.MustCompile("[评得分估]+")
|
|
|
+ nswinnertabletag = regexp.MustCompile("[评得分估]+|标的|班子成员")
|
|
|
jsonReg = regexp.MustCompile(`\{.+:[^}]*\} `) // \{".*\":\".+\"}
|
|
|
regHz = regexp.MustCompile("[\u4e00-\u9fa5]")
|
|
|
winnerOrderAndBidResult = regexp.MustCompile("((中标)?候选人|(中标|评标)结果)")
|
|
@@ -208,10 +207,6 @@ func (table *Table) KVFilter() {
|
|
|
//4.对KV的处理
|
|
|
//判断表格是否有用,调用abandontable正则数组进行判断
|
|
|
//遍历每一行
|
|
|
- winnertag := iswinnertabletag.MatchString(table.Tag) && !nswinnertabletag.MatchString(table.Tag) //table标签
|
|
|
- if !winnertag {
|
|
|
- winnertag = iswinnertabletag.MatchString(table.Tag) && !nswinnertabletag.MatchString(table.TableResult.BlockTag) //块标签
|
|
|
- }
|
|
|
table.analyTdKV() //1.遍历每行每列td的sortkv添加到table.SorkVK中;2.td有子表格的处理
|
|
|
as := NewSortMap()
|
|
|
|
|
@@ -239,11 +234,7 @@ func (table *Table) KVFilter() {
|
|
|
}
|
|
|
}
|
|
|
//处理值是数组的kv放入标准化kv中//处理table.SortKV.value为数组的情况
|
|
|
- table.sortKVArr(as, winnertag)
|
|
|
- //
|
|
|
- if filterTableWror.MatchString(table.Tag) {
|
|
|
- table.WinnerOrder = nil
|
|
|
- }
|
|
|
+ table.sortKVArr(as)
|
|
|
//
|
|
|
if len(table.WinnerOrder) > 0 || !table.BPackage {
|
|
|
winnerOrder := []map[string]interface{}{}
|
|
@@ -312,7 +303,11 @@ func (table *Table) KVFilter() {
|
|
|
}
|
|
|
|
|
|
//处理table.SortKV.value为数组的情况
|
|
|
-func (table *Table) sortKVArr(as *SortMap, winnertag bool) {
|
|
|
+func (table *Table) sortKVArr(as *SortMap) {
|
|
|
+ winnertag := iswinnertabletag.MatchString(table.Tag) && !nswinnertabletag.MatchString(table.Tag) //table标签
|
|
|
+ if !winnertag {
|
|
|
+ winnertag = iswinnertabletag.MatchString(table.TableResult.BlockTag) && !nswinnertabletag.MatchString(table.TableResult.BlockTag) //块标签
|
|
|
+ }
|
|
|
checkKey := map[int]bool{}
|
|
|
for kn, k := range as.Keys { //遍历table.SortKV.value为数组的key
|
|
|
v := as.Map[k]
|