Skip to content

Commit

Permalink
Fix LREC bibkey and bibkey volume logic (#3689)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpost authored Jul 23, 2024
1 parent cd6a0ff commit 597802c
Show file tree
Hide file tree
Showing 2 changed files with 1,564 additions and 1,558 deletions.
20 changes: 13 additions & 7 deletions bin/anthology/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,18 @@ def create_bibkey(self, paper, vidx=None):
raise Exception(
"Cannot create bibkeys when AnthologyIndex is instantiated with fast_load=True"
)

# Regular papers use the first title word, then add title words until uniqueness is achieved
title = [
w
for w in slugify(paper.get_title("plain")).split("-")
if not self._is_stopword(w, paper)
]

if paper.is_volume:
# Proceedings volumes use venue acronym instead of authors/editors
# Proceedings volumes use venue acronym instead of authors/editors, e.g., lrec-tutorials-2024
bibnames = slugify(paper.get_venue_acronym())
bibkey = f"{bibnames}-{paper.volume_id}-{paper.get('year')}"
else:
# Regular papers use author/editor names
names = paper.get("author")
Expand All @@ -232,12 +241,9 @@ def create_bibkey(self, paper, vidx=None):
bibnames = "-".join(slugify(n.last) for n, _ in names)
else:
bibnames = "nn"
title = [
w
for w in slugify(paper.get_title("plain")).split("-")
if not self._is_stopword(w, paper)
]
bibkey = f"{bibnames}-{paper.get('year')}-{title.pop(0)}"

bibkey = f"{bibnames}-{paper.get('year')}-{title.pop(0)}"

while bibkey in self.bibkeys: # guarantee uniqueness
if title:
bibkey += f"-{title.pop(0)}"
Expand Down
Loading

0 comments on commit 597802c

Please sign in to comment.