Skip to content

Commit df9d40b

Browse files
committed
Fix lint.
1 parent 09b2038 commit df9d40b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lute/book/stats.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ def calc_status_distribution(book):
2626
Does a full render of a small number of pages
2727
to calculate the distribution.
2828
"""
29-
txindex = 0
3029

3130
# DebugTimer.clear_total_summary()
3231
# dt = DebugTimer("get_status_distribution", display=False)
3332

33+
txindex = 0
3434
if (book.current_tx_id or 0) != 0:
3535
for t in book.texts:
3636
if t.id == book.current_tx_id:
@@ -42,19 +42,17 @@ def calc_status_distribution(book):
4242

4343
# Getting the individual paragraphs per page, and then combining,
4444
# is much faster than combining all pages into one giant page.
45-
lang = book.language
46-
mw = get_multiword_indexer(lang)
45+
mw = get_multiword_indexer(book.language)
4746
textitems = []
4847
for tx in texts:
49-
add_tis = [ti for ti in get_textitems(tx.text, lang, mw) if ti.is_word]
50-
textitems.extend(add_tis)
48+
textitems.extend(get_textitems(tx.text, book.language, mw))
5149
# # Old slower code:
5250
# text_sample = "\n".join([t.text for t in texts])
5351
# paras = get_paragraphs(text_sample, book.language) ... etc.
5452
# dt.step("get_paragraphs")
5553

54+
textitems = [ti for ti in textitems if ti.is_word]
5655
statterms = {0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 98: [], 99: []}
57-
5856
for ti in textitems:
5957
statterms[ti.wo_status or 0].append(ti.text_lc)
6058

0 commit comments

Comments
 (0)