Defining writer for --all

This commit is contained in:
Ozbolt Menegatti 2019-06-09 13:27:24 +02:00
parent 96e61d2f64
commit 2a437b1703

18
wani.py
View File

@ -1047,7 +1047,23 @@ class Formatter:
def length(self):
return len(self.header_repeat())
@staticmethod
class AllFormatter(Formatter):
def header_repeat(self):
return ["Token_ID", "Word_form", "Lemma", "Msd"]
def header_right(self):
return []
def content_repeat(self, words, representations, idx):
word = words[idx]
return [word.id, word.text, word.lemma, word.msd]
def content_right(self, _freq):
return []
def group(self):
return False
def make_all_writer(args):
return Writer(True, args.all, False, -1, False, False)