From c79ac42393c7d6956687fa26183d39f486b4d5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Colomb?= Date: Mon, 15 May 2023 22:13:00 +0200 Subject: [PATCH] Output the number of used terminal numbers in statistics. --- extract_tables.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extract_tables.py b/extract_tables.py index 81d49ea..c1cffa4 100644 --- a/extract_tables.py +++ b/extract_tables.py @@ -57,8 +57,9 @@ def process_db(dbfile, header=None, footer=None, indent=0): terminals = con.cursor() terminals.execute(query_terminals(f"AND tblock='{tblock}'")) - rows = 0 + used, rows = 0, 0 for term_block, tnum, term_mentions, fpositions in terminals: + used += 1 rows += 1 while rows < tnum: # Insert blank rows for never mentioned terminals @@ -67,7 +68,7 @@ def process_db(dbfile, header=None, footer=None, indent=0): rows += 1 table.writerow((tnum, f'({term_mentions})', fpositions), classes=('tnum', 'mentions', 'positions')) - print(f'{outfile.name}: {mentions=} {maxtnum=} {rows=}') + print(f'{outfile.name}: {mentions=} {maxtnum=} {rows=} {used=}') if footer: outfile.write(footer)