fix(citations): add missing bibliography entries and improve validation

Add missing citations to chapter bib files:
- carlini2021extracting to privacy_security.bib
- koomey2011web to frontiers.bib
- quinonero2009dataset to robust_ai.bib

Enhance citation validation script:
- Strip trailing punctuation (.,;:) from citation keys
- Filter out DOI-style citations (e.g., @10.1109/...)
- Prevent false positives from citations like [@key.]

These changes fix all reported citation validation failures while
improving the validation script to handle edge cases better.
This commit is contained in:
Vijay Janapa Reddi
2025-10-09 15:01:07 -04:00
parent a1498f37cd
commit 914e4bfb4d
4 changed files with 52 additions and 0 deletions

View File

@@ -60,6 +60,12 @@ def extract_citation_keys(qmd_file: Path) -> Set[str]:
# Pattern matches @word with letters, numbers, hyphens, underscores, colons, dots
citation_keys = set(re.findall(r'@([\w\-_:.]+)', content))
# Strip trailing punctuation (periods, commas) that might be captured
citation_keys = {key.rstrip('.,;:') for key in citation_keys}
# Filter out DOI-style citations (start with numbers like 10.1109)
citation_keys = {key for key in citation_keys if not re.match(r'^\d+\.\d+', key)}
# Filter out common false positives that aren't citations
filtered_keys = {
key for key in citation_keys