paper-gap 0.3.2

Local CLI for finding research papers with missing, weak, or stale public code
Documentation
use paper_gap::{paper, paper::Paper};

fn item(provider: &str, doi: Option<&str>, title: &str) -> Paper {
    Paper {
        id: format!("{provider}:{title}"),
        title: title.into(),
        abstract_text: String::new(),
        authors: Vec::new(),
        published_date: None,
        updated_date: None,
        doi: doi.map(str::to_string),
        arxiv_id: None,
        url: String::new(),
        categories: Vec::new(),
        extracted_methods: Vec::new(),
        source_provider: provider.into(),
    }
}

#[test]
fn deduplicates_by_doi_then_title() {
    let papers = paper::deduplicate(vec![
        item("arxiv", Some("10.1/ABC"), "A Paper"),
        item(
            "openalex",
            Some("https://doi.org/10.1/abc"),
            "Different Title",
        ),
        item("openalex", None, "A   Paper"),
    ]);
    assert_eq!(papers.len(), 1);
    assert_eq!(papers[0].source_provider, "arxiv");
}