Defining Formatter parent class for out/all/stats output files

pull/1/head
Ozbolt Menegatti 5 years ago
parent 2387bd7cb7
commit 96e61d2f64

@ -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)

Loading…
Cancel
Save