From 2a437b17030b3edd5761f4082be5dfd1870d5cc6 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sun, 9 Jun 2019 13:27:24 +0200 Subject: [PATCH] Defining writer for --all --- wani.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/wani.py b/wani.py index 573c031..8195b89 100644 --- a/wani.py +++ b/wani.py @@ -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)