feat: check target achieving for each feed type

This commit is contained in:
lilong.129
2023-05-03 23:51:03 +08:00
parent 94462c48bb
commit 87cba44164
3 changed files with 54 additions and 16 deletions

View File

@@ -38,6 +38,7 @@
1,
1
],
"target": 2,
"text": "^广告$"
},
{

View File

@@ -25,7 +25,7 @@ func TestAndroidVideoCrawlerTest(t *testing.T) {
"feed": map[string]interface{}{
"target_count": 5,
"target_labels": []map[string]interface{}{
{"text": "^广告$", "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": "^广告$", "scope": []float64{0, 0.5, 1, 1}, "regex": true, "target": 2},
{"text": "^图文$", "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": `^特效\|`, "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": `^模板\|`, "scope": []float64{0, 0.5, 1, 1}, "regex": true},