Fix turn count miscounting addendum lengths

This commit is contained in:
Tim Van Baak 2018-11-29 00:27:54 -08:00
parent b15fcbe359
commit c9281b6450
1 changed files with 6 additions and 1 deletions

View File

@ -197,7 +197,12 @@ def build_statistics_page(page, articles):
for turn_num in turn_numbers: for turn_num in turn_numbers:
for article in all_articles: for article in all_articles:
if article.turn <= turn_num: if article.turn <= turn_num:
aggregate[turn_num] += article_length[article.title] format_map = {
"c"+str(c.id): c.text
for c in article.citations
}
plain_content = article.content.format(**format_map)
aggregate[turn_num] += len(plain_content.split())
aggr_list = [(str(k), [str(v)]) for k,v in aggregate.items()] aggr_list = [(str(k), [str(v)]) for k,v in aggregate.items()]
content += "<div class=\"contentblock\">\n" content += "<div class=\"contentblock\">\n"
content += "<u>Aggregate word count by turn:</u><br>\n" content += "<u>Aggregate word count by turn:</u><br>\n"