Add title-turn uniqueness check
This commit is contained in:
parent
18eba7c035
commit
8773f6b58f
|
@ -172,6 +172,13 @@ class LexiconArticle:
|
|||
Fills out fields on articles that require other articles for context.
|
||||
Creates phantom articles.
|
||||
"""
|
||||
# Preliminary assertion that title/turn is unique
|
||||
keys = set()
|
||||
for article in lexicon_articles:
|
||||
if (article.title, article.turn) in keys:
|
||||
raise ValueError("Found two articles with title '{}' and turn '{}'".format(
|
||||
article.title, article.turn))
|
||||
keys.add((article.title, article.turn))
|
||||
# Sort out which articles are addendums and which titles are phantoms
|
||||
written_titles = set()
|
||||
cited_titles = set()
|
||||
|
|
Loading…
Reference in New Issue