GodsDevProject commited on
Commit
939bc7f
·
verified ·
1 Parent(s): c7b002a

Create ingest/utils.py

Browse files
Files changed (1) hide show
  1. ingest/utils.py +7 -23
ingest/utils.py CHANGED
@@ -1,25 +1,9 @@
1
- def highlight_terms(text: str, query: str) -> str:
2
- if not text or not query:
3
- return text
4
- return text.replace(query, f"**{query}**")
5
-
6
-
7
- def classify_foia_exemptions(text: str):
8
- # Explainable, rule-based, non-inferential
9
- exemptions = []
10
- lowered = text.lower()
11
- if "national security" in lowered:
12
- exemptions.append("b(1)")
13
- if "internal personnel" in lowered:
14
- exemptions.append("b(2)")
15
- if "privacy" in lowered:
16
- exemptions.append("b(6)")
17
- return exemptions or ["none"]
18
-
19
-
20
- def format_citation(record: dict) -> str:
21
  return (
22
- f"{record.get('source')}. "
23
- f"\"{record.get('title')}\". "
24
- f"Retrieved from {record.get('url')}."
25
  )
 
1
+ def format_bluebook_citation(r: dict) -> str:
2
+ """
3
+ Court-ready, conservative Bluebook-style citation
4
+ """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  return (
6
+ f"{r.get('source')}, "
7
+ f"{r.get('title')}, "
8
+ f"available at {r.get('url')}."
9
  )