GodsDevProject commited on
Commit
ff4e0c4
·
verified ·
1 Parent(s): 5d60aff

Create ingest/linking.py

Browse files
Files changed (1) hide show
  1. ingest/linking.py +12 -0
ingest/linking.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def link_clusters_to_timeline(results, clusters):
2
+ """
3
+ Build index maps so timeline & clusters can cross-highlight
4
+ """
5
+ doc_index = {}
6
+ for idx, r in enumerate(results):
7
+ doc_index[r["id"]] = {
8
+ "index": idx,
9
+ "date": r.get("date"),
10
+ "cluster": r.get("cluster"),
11
+ }
12
+ return doc_index