Browse Source

正则抽取正文

fengweiqiang 6 năm trước cách đây
mục cha
commit
d5c807ce38
2 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 2
      src/jy/pretreated/analystep.go
  2. 0 2
      src/jy/pretreated/analytable.go

+ 3 - 2
src/jy/pretreated/analystep.go

@@ -6,6 +6,7 @@ package pretreated
 import (
 	"encoding/json"
 	"jy/util"
+
 	//"log"
 	"strings"
 
@@ -56,7 +57,6 @@ func AnalyStart(job *util.Job) {
 			newCon = TextAfterRemoveTable(con)
 			job.BlockPackage = FindPackageFromText(job.Title, newCon)
 			for i := 0; i < len(tabs); i++ {
-
 				//添加标识:文本中有table
 				tabres := AnalyTableV2(tabs[i], job.Category, "", con, 1, job.SourceMid, job.RuleBlock) //解析表格入口 返回:汇总表格对象
 				processTableResult(tabres, bl, job)
@@ -69,7 +69,7 @@ func AnalyStart(job *util.Job) {
 			job.BlockPackage = FindPackageFromText(job.Title, newCon)
 		}
 		FindProjectCode(newCon, job) //匹配项目编号
-		bl.Text = newCon
+		bl.Text = HtmlToText(con)
 		//调用kv解析
 		bl.ColonKV = GetKVAll(newCon, "", nil, 1)
 		bl.SpaceKV = SspacekvEntity.Entrance(newCon, "", nil)
@@ -77,6 +77,7 @@ func AnalyStart(job *util.Job) {
 		if job.Winnerorder == nil || len(job.Winnerorder) == 0 {
 			bl.Winnerorder = winnerOrderEntity.Find(bl.Text, true, 1)
 		}
+		//log.Println(bl.Text)
 		job.Block = append(job.Block, bl)
 	}
 }

+ 0 - 2
src/jy/pretreated/analytable.go

@@ -3,7 +3,6 @@ package pretreated
 import (
 	"fmt"
 	u "jy/util"
-	"log"
 	qutil "qfw/util"
 	"regexp"
 	"strings"
@@ -790,7 +789,6 @@ func (tn *Table) AnalyTables(contactFormat *u.ContactFormat) []*Table {
 			table.TdContactFormat(contactFormat) //contactFormat,处理采购单位,代理机构
 			//开始查找kv,核心模块,table.SortKV
 			table.FindKV()
-			log.Println(table.SortKV.Map)
 			//table中抽取品牌,table.BrandData
 			if u.IsBrandGoods {
 				table.analyBrand()