From 2387bd7cb7a25012339f021994cb17f743a4ba90 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sun, 9 Jun 2019 10:20:29 +0200 Subject: [PATCH] Stats flag --- wani.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wani.py b/wani.py index c4488a6..916ad88 100644 --- a/wani.py +++ b/wani.py @@ -1024,16 +1024,17 @@ class Writer: @staticmethod def make_output_writer(args): return Writer(False, args.output, args.multiple_output, - int(args.sort_by), args.sort_reversed) + int(args.sort_by), args.sort_reversed, args.stats) @staticmethod def make_all_writer(args): - return Writer(True, args.all, False, -1, False) + return Writer(True, args.all, False, -1, False, False) - def __init__(self, all, filename, multiple_output, sort_by, sort_reversed): + def __init__(self, all, filename, multiple_output, sort_by, sort_reversed, stats): self.all = all self.output_file = filename self.multiple_output = multiple_output + self.stats = stats self.sort_by = sort_by self.sort_order = sort_reversed @@ -1328,6 +1329,8 @@ if __name__ == '__main__': parser.add_argument('--multiple-output', help='Generate one output for each syntactic structure', action='store_true') + parser.add_argument('--stats', + help='Output file should contain statistics', action='store_true') parser.add_argument('--sort-by', help="Sort by a this column (index)", type=int, default=-1)