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

Function _normalized_report_dedupe_key

deployments/desktop/shared/agents.py:717–725  ·  view source on GitHub ↗
(report: Dict[str, Any])

Source from the content-addressed store, hash-verified

715 return source_type in {"arxiv", "pdf", "local_pdf", "feishu_file_key", "reading_report"}
716
717
718def _normalized_report_dedupe_key(report: Dict[str, Any]) -> str:
719 arxiv_id = str(report.get("arxiv_id") or "").strip().lower()
720 if arxiv_id:
721 return f"arxiv:{arxiv_id}"
722 doi = str((report.get("metadata") or {}).get("doi") or "").strip().lower()
723 if doi:
724 return f"doi:{doi}"
725 title = re.sub(r"[^a-z0-9]+", " ", str(report.get("title") or "").lower()).strip()
726 return f"title:{title}" if title else f"path:{report.get('report_path') or report.get('report_id')}"
727
728

Callers 1

_all_report_recordsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected