MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / paper_exists

Function paper_exists

scripts/collect_all_papers.py:64–72  ·  view source on GitHub ↗

检查论文是否已存在

(conn: sqlite3.Connection, paper_id: str, source: str)

Source from the content-addressed store, hash-verified

62
63
64def paper_exists(conn: sqlite3.Connection, paper_id: str, source: str) -> bool:
65 """检查论文是否已存在"""
66 if source == "arxiv":
67 cursor = conn.execute("SELECT 1 FROM papers WHERE arxiv_id = ?", (paper_id,))
68 elif source in ("cvf", "ecva", "dblp"):
69 cursor = conn.execute("SELECT 1 FROM papers WHERE doi = ?", (paper_id,))
70 else:
71 cursor = conn.execute("SELECT 1 FROM papers WHERE doi = ? OR title = ?", (paper_id, paper_id))
72 return cursor.fetchone() is not None
73
74
75def normalize_paper(paper: Dict, source: str) -> Dict:

Callers 1

collect_from_sourceFunction · 0.70

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected