Defining Formatter parent class for out/all/stats output files
This commit is contained in:
parent
2387bd7cb7
commit
96e61d2f64
21
wani.py
21
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user