@@ -26,11 +26,11 @@ def calc_status_distribution(book):
26
26
Does a full render of a small number of pages
27
27
to calculate the distribution.
28
28
"""
29
- txindex = 0
30
29
31
30
# DebugTimer.clear_total_summary()
32
31
# dt = DebugTimer("get_status_distribution", display=False)
33
32
33
+ txindex = 0
34
34
if (book .current_tx_id or 0 ) != 0 :
35
35
for t in book .texts :
36
36
if t .id == book .current_tx_id :
@@ -42,19 +42,17 @@ def calc_status_distribution(book):
42
42
43
43
# Getting the individual paragraphs per page, and then combining,
44
44
# 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 )
47
46
textitems = []
48
47
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 ))
51
49
# # Old slower code:
52
50
# text_sample = "\n".join([t.text for t in texts])
53
51
# paras = get_paragraphs(text_sample, book.language) ... etc.
54
52
# dt.step("get_paragraphs")
55
53
54
+ textitems = [ti for ti in textitems if ti .is_word ]
56
55
statterms = {0 : [], 1 : [], 2 : [], 3 : [], 4 : [], 5 : [], 98 : [], 99 : []}
57
-
58
56
for ti in textitems :
59
57
statterms [ti .wo_status or 0 ].append (ti .text_lc )
60
58
0 commit comments