|
@@ -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("[评得分估]+|标的|班子成员")
|
|
|
projectcodeRegAll = regexp.MustCompile(`(采购项目|项目)名称及[项目]?编号[:|:]?.*[\n]?`)
|
|
|
projectcodeRegAll2 = regexp.MustCompile("[((].{4,30}[))]")
|
|
|
projectcodeReg = regexp.MustCompile(`((|\(|\[){1}(^([\s]?编号)|项目编号|标段编号|招标编号){1}(:|:)(.){4,30}()|\)|\])`)
|
|
@@ -213,10 +212,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()
|
|
|
|
|
@@ -244,11 +239,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{}{}
|
|
@@ -317,7 +308,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]
|