move all trend filters from gatherer to hunter
This commit is contained in:
parent
9a27b117a8
commit
1092194bba
|
@ -84,18 +84,8 @@ impl TrendAnalyzer {
|
|||
}
|
||||
|
||||
pub fn process_tag(&mut self, name: &Arc<String>, tag: &Arc<TrendTag>) {
|
||||
if tag.hosts().skip(1).next().is_none() {
|
||||
// ignore spam that is posted by accounts on <1 host
|
||||
return;
|
||||
}
|
||||
|
||||
let score = tag.score(self.period, self.until);
|
||||
|
||||
if score <= 0. {
|
||||
// // discard downwards trends
|
||||
return;
|
||||
}
|
||||
|
||||
if self.score_threshold.map_or(false, |score_threshold| score < score_threshold) {
|
||||
// score is below self.result[..self.size].score
|
||||
return;
|
||||
|
|
|
@ -123,7 +123,9 @@ async fn run(
|
|||
for trend_tag in &trend_tags {
|
||||
for (period, scores) in &mut period_scores {
|
||||
let score = trend_tag.score(*period, until);
|
||||
scores.push((score, trend_tag));
|
||||
if score > 0. {
|
||||
scores.push((score, trend_tag));
|
||||
}
|
||||
}
|
||||
}
|
||||
// order
|
||||
|
|
Loading…
Reference in New Issue
Block a user