|
@@ -534,10 +534,14 @@ func AnalyTableV2(tabs []*goquery.Selection, toptype, blockTag, con string, ityp
|
|
|
//开始解析表格集
|
|
|
func (ts *TableResult) Analy() {
|
|
|
tabs := []*Table{}
|
|
|
+ contactFormat := &u.ContactFormat{
|
|
|
+ IndexMap: map[int]string{},
|
|
|
+ MatchMap: map[string]map[string]bool{},
|
|
|
+ }
|
|
|
for _, table := range ts.GoqueryTabs {
|
|
|
tn := NewTable(ts.Html, ts, table)
|
|
|
//核心模块
|
|
|
- ts := tn.Analy()
|
|
|
+ ts := tn.Analy(contactFormat)
|
|
|
for _, tab := range ts {
|
|
|
tabs = append(tabs, tab)
|
|
|
//log.Println("tab.SortKV.Map", tab.SortKV.Map)
|
|
@@ -621,7 +625,7 @@ func (ts *TableResult) Analy() {
|
|
|
}
|
|
|
|
|
|
//解析表格
|
|
|
-func (table *Table) Analy() []*Table {
|
|
|
+func (table *Table) Analy(contactFormat *u.ContactFormat) []*Table {
|
|
|
//查找表体中的tr对象
|
|
|
trs := table.Goquery.ChildrenFiltered("tbody,thead,tfoot").ChildrenFiltered("tr")
|
|
|
if trs.Size() == 0 {
|
|
@@ -729,7 +733,7 @@ func (table *Table) Analy() []*Table {
|
|
|
table.Adjust()
|
|
|
//查找表格的标签
|
|
|
table.FindTag()
|
|
|
- //u.Debug(table.TableResult.Id, table.Tag)
|
|
|
+ //log.Println(table.TableResult.Id, table.Html)
|
|
|
//分割表格
|
|
|
if table.BSplit {
|
|
|
if !table.BHeader && n > 0 {
|
|
@@ -751,7 +755,7 @@ func (table *Table) Analy() []*Table {
|
|
|
table.StandKV["项目名称"] = table.Tag
|
|
|
table.StandKVWeight["项目名称"] = -100
|
|
|
}
|
|
|
- //table.TdContactFormat(contactFormat)
|
|
|
+ table.TdContactFormat(contactFormat)
|
|
|
//开始查找kv,核心模块
|
|
|
table.FindKV()
|
|
|
//判断是否是多包,并处理分包的
|
|
@@ -1290,15 +1294,17 @@ func (table *Table) FindKV() {
|
|
|
}
|
|
|
**/
|
|
|
if !td.BH && td.KVDirect < 3 {
|
|
|
- if !table.FindTdVal(td, vdirect, direct) {
|
|
|
- //都识别不到时,对第一、二中标候选人的处理
|
|
|
- bo, res := GetBidOrder(td, bodirect, sort)
|
|
|
- if res {
|
|
|
- sort++
|
|
|
- bodirect = bo
|
|
|
+ if !table.FindTdVal(td, direct, vdirect) {
|
|
|
+ if !table.FindTdVal(td, vdirect, direct) {
|
|
|
+ //都识别不到时,对第一、二中标候选人的处理
|
|
|
+ bo, res := GetBidOrder(td, bodirect, sort)
|
|
|
+ if res {
|
|
|
+ sort++
|
|
|
+ bodirect = bo
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- //u.Debug(td.Val, td.BH, td.HeadTd, td.KVDirect)
|
|
|
+ //log.Println("td", td.Val, td.BH, td.HeadTd, td.KVDirect)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1457,7 +1463,6 @@ func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
|
|
|
if near != nil && near.BH && (near.KeyDirect == vdirect || near.KeyDirect == 0) && (near.KVDirect == direct || near.KVDirect == 0) && near.KVDirect < 3 {
|
|
|
near.KVDirect = direct
|
|
|
near.KeyDirect = vdirect
|
|
|
- //u.Debug(direct, near.KVDirect, near.Val, td.Val)
|
|
|
td.KVDirect = direct
|
|
|
key := near.Val
|
|
|
if near.Val == "" {
|
|
@@ -2165,3 +2170,406 @@ func replPkgConfusion(v1 string) string {
|
|
|
v1 = PreCon2.ReplaceAllString(v1, "")
|
|
|
return v1
|
|
|
}
|
|
|
+
|
|
|
+//对td中的值,进行再处理
|
|
|
+func (tn *Table) TdContactFormat(contactFormat *u.ContactFormat) {
|
|
|
+ //处理表格中的联系人信息
|
|
|
+ indexMap := contactFormat.IndexMap
|
|
|
+ matchMap := contactFormat.MatchMap
|
|
|
+ weightMap := map[string]map[string]interface{}{} //权重
|
|
|
+ mustMatchFirst := len(indexMap) > 0 //第一个必须匹配上
|
|
|
+ reCreate := false
|
|
|
+ matchCount := 0
|
|
|
+ contactTypeTagMap := map[string]map[string][]interface{}{}
|
|
|
+ //u.Debug(mustMatchFirst, indexMap, matchMap)
|
|
|
+ notMatchTrCount := 0
|
|
|
+ allAscFind := true
|
|
|
+ if len(indexMap) == 0 {
|
|
|
+ isCanAddToIndexMap := false
|
|
|
+ matchPrevFlag := false
|
|
|
+ prevCanAddToIndexMap := false
|
|
|
+ LS:
|
|
|
+ for _, tr := range tn.TRs {
|
|
|
+ for td_index, td := range tr.TDs {
|
|
|
+ thisTdKvs := colonkvEntity.GetKvs(td.Text, "", 2)
|
|
|
+ if len(thisTdKvs) == 0 {
|
|
|
+ tdValue := regReplAllSpace.ReplaceAllString(td.Text, "")
|
|
|
+ if tdValue != "" && len([]rune(tdValue)) < 10 {
|
|
|
+ thisTdKvs = append(thisTdKvs, &u.Kv{
|
|
|
+ Key: tdValue,
|
|
|
+ Value: "",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(thisTdKvs) != 1 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ //采购人在联系人、电话后面的处理
|
|
|
+ td_k := FilterContactKey(thisTdKvs[0].Key)
|
|
|
+ td_k_length := len([]rune(td_k))
|
|
|
+ if td_k_length < 2 || td_k_length > 15 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ isContinue := ContactInfoMustReg.MatchString(td_k)
|
|
|
+ if isContinue || (ContactInfoVagueReg.MatchString(td_k) && u.IsMapHasValue(td_k, ContactType)) {
|
|
|
+ if !matchPrevFlag && len(indexMap) > 0 {
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ break LS
|
|
|
+ }
|
|
|
+ isCanAddToIndexMap = true
|
|
|
+ }
|
|
|
+ if isContinue {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ for _, k := range HasOrderContactType(td_k) {
|
|
|
+ if !ContactType[k].MatchString(td_k) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if len(indexMap) == 0 {
|
|
|
+ if isCanAddToIndexMap || (prevCanAddToIndexMap && len(tr.TDs) == 1) {
|
|
|
+ myPrevTdVal := ""
|
|
|
+ if td_index-2 >= 0 {
|
|
|
+ myPrevTdVal = tr.TDs[td_index-2].Val
|
|
|
+ }
|
|
|
+ if myPrevTdVal != "" && len([]rune(myPrevTdVal)) < 10 && ContactInfoMustReg.MatchString(myPrevTdVal) {
|
|
|
+ matchPrevFlag = true
|
|
|
+ }
|
|
|
+ indexMap[0] = k
|
|
|
+ break
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ break LS
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ prevCanAddToIndexMap = isCanAddToIndexMap
|
|
|
+ isCanAddToIndexMap = false
|
|
|
+ }
|
|
|
+ if len(indexMap) > 0 {
|
|
|
+ allAscFind = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //////
|
|
|
+L:
|
|
|
+ for tr_index, tr := range tn.TRs {
|
|
|
+ thisTrHasMatch := false
|
|
|
+ jumpNextTd := false
|
|
|
+ for td_index, td := range tr.TDs {
|
|
|
+ //和|以?及|与|、多个词和在一起
|
|
|
+ if !jumpNextTd && len([]rune(td.Text)) >= 5 && len([]rune(td.Text)) <= 15 && regSplit.MatchString(td.Text) && td_index+1 < len(tr.TDs) {
|
|
|
+ thisTdVals := regSplit.Split(td.Text, -1)
|
|
|
+ nextTdVals := MultipleValueSplitReg.Split(tr.TDs[td_index+1].Val, -1)
|
|
|
+ if len(thisTdVals) == len(nextTdVals) {
|
|
|
+ isHandle := false
|
|
|
+ for _, k := range HasOrderContactType(td.Text) {
|
|
|
+ if ContactType[k].MatchString(td.Text) {
|
|
|
+ for thisTdVals_k, thisTdVals_v := range thisTdVals {
|
|
|
+ thisTdVals_v = strings.TrimSpace(thisTdVals_v)
|
|
|
+ if ContactType[k].MatchString(thisTdVals_v) {
|
|
|
+ thisTrHasMatch = true
|
|
|
+ tr.TDs[td_index+1].SortKV.AddKey(thisTdVals_v, nextTdVals[thisTdVals_k])
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if !ContactInfoMustReg.MatchString(thisTdVals_v) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ jumpNextTd = true
|
|
|
+ thisTrHasMatch = true
|
|
|
+ tr.TDs[td_index+1].SortKV.AddKey(k+thisTdVals_v, nextTdVals[thisTdVals_k])
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if !isHandle && len(indexMap) > 0 {
|
|
|
+ _, onlyContactType := u.FirstKeyValueInMap(indexMap)
|
|
|
+ if myContactType, _ := onlyContactType.(string); myContactType != "" {
|
|
|
+ for thisTdVals_k, thisTdVals_v := range thisTdVals {
|
|
|
+ thisTdVals_v = strings.TrimSpace(thisTdVals_v)
|
|
|
+ if ContactInfoMustReg.MatchString(thisTdVals_v) {
|
|
|
+ jumpNextTd = true
|
|
|
+ thisTrHasMatch = true
|
|
|
+ tr.TDs[td_index+1].SortKV.AddKey(myContactType+thisTdVals_v, nextTdVals[thisTdVals_k])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ jumpNextTd = false
|
|
|
+ }
|
|
|
+ ///////////////////////////////////////
|
|
|
+ thisTdKvs := kvAfterDivideBlock(td.Text, 3)
|
|
|
+ if len(thisTdKvs) == 0 {
|
|
|
+ thisTdKvs = colonkvEntity.GetKvs(td.Text, "", 2)
|
|
|
+ }
|
|
|
+ if len(thisTdKvs) == 0 {
|
|
|
+ tdValue := regReplAllSpace.ReplaceAllString(td.Text, "")
|
|
|
+ if tdValue != "" && len([]rune(tdValue)) < 15 {
|
|
|
+ thisTdKvs = append(thisTdKvs, &u.Kv{
|
|
|
+ Key: tdValue,
|
|
|
+ Value: "",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tdAscFind := true
|
|
|
+ if len(thisTdKvs) == 0 {
|
|
|
+ continue
|
|
|
+ } else if allAscFind && len(thisTdKvs) >= 3 && len(indexMap) == 0 {
|
|
|
+ //采购人在联系人、电话后面的处理
|
|
|
+ isCanAddToIndexMap := false
|
|
|
+ LL:
|
|
|
+ for _, td_kv := range thisTdKvs {
|
|
|
+ //u.Debug(td_kv.PrevLine)
|
|
|
+ td_k := FilterContactKey(td_kv.Key)
|
|
|
+ td_k_length := len([]rune(td_k))
|
|
|
+ if td_k_length < 2 || td_k_length > 15 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ isContinue := ContactInfoMustReg.MatchString(td_k)
|
|
|
+ if isContinue || (ContactInfoVagueReg.MatchString(td_k) && u.IsMapHasValue(td_k, ContactType)) {
|
|
|
+ if len(indexMap) > 0 {
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ break LL
|
|
|
+ }
|
|
|
+ isCanAddToIndexMap = true
|
|
|
+ }
|
|
|
+ if isContinue {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if len(indexMap) == 0 {
|
|
|
+ for _, k := range HasOrderContactType(td_k) {
|
|
|
+ if !ContactType[k].MatchString(td_k) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if isCanAddToIndexMap && len(indexMap) == 0 {
|
|
|
+ indexMap[0] = k
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(indexMap) > 0 {
|
|
|
+ tdAscFind = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ prevKey := ""
|
|
|
+ oldIndexMapLength := len(indexMap)
|
|
|
+ thidTdIndex := td_index
|
|
|
+ notmatchCount := 0
|
|
|
+ kvTitle := ""
|
|
|
+ for _, td_kv := range thisTdKvs {
|
|
|
+ //u.Debug(td_kv.Key, td_kv.Value, td_kv.Title)
|
|
|
+ iscontinue := false
|
|
|
+ td_v := td_kv.Value
|
|
|
+ td_k := FilterContactKey(td_kv.Key)
|
|
|
+ td_k_length := len([]rune(td_k))
|
|
|
+ //
|
|
|
+ if allAscFind && tdAscFind {
|
|
|
+ for _, k := range HasOrderContactType(td_k) {
|
|
|
+ if td_k_length < 3 || td_k_length > 15 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if !ContactType[k].MatchString(td_k) {
|
|
|
+ matchCount++
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if weightMap[k] == nil {
|
|
|
+ weightMap[k] = map[string]interface{}{}
|
|
|
+ }
|
|
|
+ if ContactInfoVagueReg.MatchString(td_k) {
|
|
|
+ if matchMap[k] == nil {
|
|
|
+ matchMap[k] = map[string]bool{}
|
|
|
+ }
|
|
|
+ isAddToMatchMap := true
|
|
|
+ if !strings.HasSuffix(td_k, "方式") {
|
|
|
+ _, kTag := KvTagsToKV([]*u.Kv{&u.Kv{Key: td_k, Value: td_v}}, "", BuyerContacts, 3)
|
|
|
+ if len(kTag) == 1 {
|
|
|
+ tagVal, weightVal := u.FirstKeyValueInMap(kTag)
|
|
|
+ if tagVal == "采购单位联系人" && ContactBuyerPersonFilterReg.MatchString(td_v) {
|
|
|
+ isAddToMatchMap = false
|
|
|
+ }
|
|
|
+ if td.SortKV.Map[tagVal] != nil {
|
|
|
+ if weightMap[k][tagVal] == nil || (weightVal != nil && weightVal.(int) >= weightMap[k][tagVal].(int)) {
|
|
|
+ weightMap[k][tagVal] = weightVal.(int)
|
|
|
+ td.SortKV.AddKey(tagVal, td_v)
|
|
|
+ thisTrHasMatch = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ weightMap[k][tagVal] = weightVal.(int)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isAddToMatchMap && !filterValue.MatchString(td_v) && td_v != "" {
|
|
|
+ matchMap[k][ContactInfoVagueReg.FindString(td_k)] = true
|
|
|
+ }
|
|
|
+ } else if k == "采购单位" { //打标签,权重高的重新覆盖
|
|
|
+ _, kTag := KvTagsToKV([]*u.Kv{td_kv}, "", []string{"采购单位"}, 3)
|
|
|
+ tagVal, weightVal := u.FirstKeyValueInMap(kTag)
|
|
|
+ if tagVal == k {
|
|
|
+ if weightMap[k][k] == nil || (weightVal != nil && weightVal.(int) >= weightMap[k][k].(int)) || len(matchMap[k]) == 0 {
|
|
|
+ weightMap[k][k] = weightVal.(int)
|
|
|
+ matchMap[k] = map[string]bool{}
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if u.IsMapHasValue(k, indexMap) {
|
|
|
+ thisTrHasMatch = true
|
|
|
+ iscontinue = true
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if reCreate {
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ reCreate = false
|
|
|
+ }
|
|
|
+ indexMap[thidTdIndex] = k
|
|
|
+ iscontinue = true
|
|
|
+ thisTrHasMatch = true
|
|
|
+ thidTdIndex++
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if len(indexMap) == 0 {
|
|
|
+ prevLine := FilterSerial.ReplaceAllString(td_kv.PrevLine, "")
|
|
|
+ for k, v := range ContactType {
|
|
|
+ if u.IsArrayHasValue(prevLine, v.FindAllString(prevLine, -1)) {
|
|
|
+ indexMap[thidTdIndex] = k
|
|
|
+ thisTrHasMatch = true
|
|
|
+ thidTdIndex++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(indexMap) == 0 {
|
|
|
+ if titleMatchType := ContactTypeTitleMatch(td_kv.Title); titleMatchType != "" {
|
|
|
+ thidTdIndex = 0
|
|
|
+ matchMap = map[string]map[string]bool{}
|
|
|
+ indexMap = map[int]string{1: titleMatchType}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if iscontinue {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ //不在同一块中
|
|
|
+ if td_kv.Title != "" && kvTitle != td_kv.Title && len(indexMap) > 0 && !ContactInfoMustReg.MatchString(td_kv.Key) {
|
|
|
+ thidTdIndex = 0
|
|
|
+ matchMap = map[string]map[string]bool{}
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ }
|
|
|
+ kvTitle = td_kv.Title
|
|
|
+ //u.Debug(indexMap, td_k, td_v, matchMap)
|
|
|
+ if len(indexMap) > 0 {
|
|
|
+ if td_k_length < 2 || td_k_length > 10 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ modle := 0
|
|
|
+ if len(thisTdKvs) == 1 {
|
|
|
+ if regReplAllSpace.ReplaceAllString(thisTdKvs[0].Value, "") == "" {
|
|
|
+ modle = 1
|
|
|
+ } else {
|
|
|
+ modle = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if !ContactInfoMustReg.MatchString(td_k) {
|
|
|
+ notmatchCount++
|
|
|
+ if notmatchCount < len(indexMap)*2 && false {
|
|
|
+ notmatchCount = 0
|
|
|
+ thidTdIndex = 0
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ matchMap = map[string]map[string]bool{}
|
|
|
+ }
|
|
|
+ if mustMatchFirst {
|
|
|
+ break L
|
|
|
+ }
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ reCreate = true
|
|
|
+ index := td_index
|
|
|
+ if oldIndexMapLength == 0 && len(indexMap) > 1 {
|
|
|
+ if prevKey != td_k {
|
|
|
+ prevKey = td_k
|
|
|
+ index = td_index
|
|
|
+ } else if prevKey == td_k {
|
|
|
+ index++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if filterValue.MatchString(td_v) {
|
|
|
+ thisTrHasMatch = true
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ //u.Debug(indexMap, td_k, td_v, matchMap, index, modle)
|
|
|
+ myContactType := indexMap[index]
|
|
|
+ if myContactType == "" && len(indexMap) == 1 {
|
|
|
+ _, onlyContactType := u.FirstKeyValueInMap(indexMap)
|
|
|
+ myContactType, _ = onlyContactType.(string)
|
|
|
+ }
|
|
|
+ if myContactType == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ matchCount++
|
|
|
+ if matchMap[myContactType] == nil {
|
|
|
+ matchMap[myContactType] = map[string]bool{}
|
|
|
+ }
|
|
|
+ if IsContactKvHandle(ContactInfoMustReg.FindString(td_k), matchMap[myContactType]) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ matchMap[myContactType][ContactInfoMustReg.FindString(td_k)] = true
|
|
|
+ if ContactType[myContactType].MatchString(td_k) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ thisTrHasMatch = true
|
|
|
+ if modle == 1 {
|
|
|
+ td.Text = myContactType + td_k
|
|
|
+ td.Val = td.Text
|
|
|
+ } else {
|
|
|
+ //
|
|
|
+ if !strings.HasSuffix(td_k, "方式") {
|
|
|
+ _, kTag := KvTagsToKV([]*u.Kv{&u.Kv{Key: myContactType + td_k, Value: td_v}}, "", BuyerContacts, 3)
|
|
|
+ if len(kTag) == 1 {
|
|
|
+ tagVal, _ := u.FirstKeyValueInMap(kTag)
|
|
|
+ if tagVal == "采购单位联系人" && ContactBuyerPersonFilterReg.MatchString(td_v) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if contactTypeTagMap[myContactType] == nil {
|
|
|
+ contactTypeTagMap[myContactType] = map[string][]interface{}{}
|
|
|
+ }
|
|
|
+ myOldKeyArray := contactTypeTagMap[myContactType][tagVal]
|
|
|
+ if myOldKeyArray != nil {
|
|
|
+ tn.TRs[myOldKeyArray[0].(int)].TDs[myOldKeyArray[1].(int)].SortKV.RemoveKey(myContactType + myOldKeyArray[2].(string))
|
|
|
+ } else {
|
|
|
+ contactTypeTagMap[myContactType][tagVal] = make([]interface{}, 3)
|
|
|
+ }
|
|
|
+ if weightMap[myContactType] == nil {
|
|
|
+ weightMap[myContactType] = map[string]interface{}{}
|
|
|
+ }
|
|
|
+ weightMap[myContactType][tagVal] = 1
|
|
|
+ contactTypeTagMap[myContactType][tagVal] = []interface{}{tr_index, td_index, td_k}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ td.SortKV.AddKey(myContactType+td_k, td_v)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //u.Debug(td.SortKV.Map)
|
|
|
+ }
|
|
|
+ if allAscFind && !thisTrHasMatch {
|
|
|
+ notMatchTrCount++
|
|
|
+ if notMatchTrCount >= 2 {
|
|
|
+ notMatchTrCount = 0
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //u.Debug("end", matchCount, indexMap, matchMap)
|
|
|
+ if matchCount == 0 {
|
|
|
+ indexMap = map[int]string{}
|
|
|
+ matchMap = map[string]map[string]bool{}
|
|
|
+ }
|
|
|
+ (*contactFormat).IndexMap = indexMap
|
|
|
+ (*contactFormat).MatchMap = matchMap
|
|
|
+ // for _, tr := range tn.TRs {
|
|
|
+ // for _, td := range tr.TDs {
|
|
|
+ // log.Println(td.SortKV.Map)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+}
|