From 96e61d2f6476080f73ce9aee8d700c45bc5d0c0f Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sun, 9 Jun 2019 13:27:04 +0200 Subject: [PATCH] Defining Formatter parent class for out/all/stats output files --- wani.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/wani.py b/wani.py index 916ad88..573c031 100644 --- a/wani.py +++ b/wani.py @@ -1026,6 +1026,27 @@ class Writer: return Writer(False, args.output, args.multiple_output, int(args.sort_by), args.sort_reversed, args.stats) +class Formatter: + def __init__(self, colocation_ids): + self.colocation_ids = colocation_ids + self.additional_init() + + def header_repeat(self): + raise NotImplementedError("Header repeat formatter not implemented") + def header_right(self): + raise NotImplementedError("Header right formatter not implemented") + def content_repeat(self, words, representations, idx): + raise NotImplementedError("Content repeat formatter not implemented") + def content_right(self, freq): + raise NotImplementedError("Content right formatter not implemented") + def group(self): + raise NotImplementedError("Group for formatter not implemented") + + def additional_init(self): + pass + def length(self): + return len(self.header_repeat()) + @staticmethod def make_all_writer(args): return Writer(True, args.all, False, -1, False, False)