Skip to content

Commit

Permalink
Output the number of used terminal numbers in statistics.
Browse files Browse the repository at this point in the history
  • Loading branch information
acolomb committed May 15, 2023
1 parent 0904bda commit c79ac42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extract_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit c79ac42

Please sign in to comment.