use crate::fact::MemoFact;
use crate::scoring::ScoringEngine;

pub fn rank(mut facts: Vec<MemoFact>) -> Vec<MemoFact> {
    facts.sort_by(|a, b| {
        ScoringEngine::score(b)
            .partial_cmp(&ScoringEngine::score(a))
            .unwrap()
    });
    facts
}
