adding timeinfo
This commit is contained in:
@@ -18,6 +18,7 @@ from word_stats import WordStats
|
||||
from writer import Writer
|
||||
from loader import load_files
|
||||
from database import Database
|
||||
from time_info import TimeInfo
|
||||
|
||||
|
||||
def match_file(words, structures):
|
||||
@@ -38,6 +39,7 @@ def match_file(words, structures):
|
||||
|
||||
def main(args):
|
||||
structures, lemma_msds, max_num_components = build_structures(args)
|
||||
timeinfo = TimeInfo(len(args.input))
|
||||
|
||||
database = Database(args)
|
||||
match_store = MatchStore(args, database)
|
||||
@@ -45,8 +47,10 @@ def main(args):
|
||||
|
||||
for words in load_files(args, database):
|
||||
if words is None:
|
||||
timeinfo.add_measurement(-1)
|
||||
continue
|
||||
|
||||
start_time = time.time()
|
||||
matches = match_file(words, structures)
|
||||
match_store.add_matches(matches)
|
||||
word_stats.add_words(words)
|
||||
@@ -57,6 +61,9 @@ def main(args):
|
||||
del matches
|
||||
gc.collect()
|
||||
|
||||
timeinfo.add_measurement(time.time() - start_time)
|
||||
timeinfo.info()
|
||||
|
||||
# if no output files, just exit
|
||||
if all([x == None for x in [args.out, args.out_no_stat, args.all, args.stats]]):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user