Adding msd to out formatter

This commit is contained in:
Ozbolt Menegatti 2019-07-01 17:18:25 +02:00
parent 47340fe80c
commit 1401b82324

View File

@ -37,7 +37,7 @@ class OutNoStatFormatter(Formatter):
self.representation = "" self.representation = ""
def header_repeat(self): def header_repeat(self):
return ["Lemma", "Representative_form", "RF_scenario"] return ["Lemma", "Representative_form", "RF_msd", "RF_scenario"]
def header_right(self): def header_right(self):
return ["Joint_representative_form", "Frequency"] return ["Joint_representative_form", "Frequency"]
@ -50,10 +50,10 @@ class OutNoStatFormatter(Formatter):
rep = representations[idx] rep = representations[idx]
if rep is None: if rep is None:
self.representation += " " + word.lemma self.representation += " " + word.lemma
return [word.lemma, word.lemma, "lemma_fallback"] return [word.lemma, word.lemma, "", "lemma_fallback"]
else: else:
self.representation += " " + rep self.representation += " " + rep
return [word.lemma, rep, "ok"] return [word.lemma, rep, word.msd, "ok"]
def content_right(self, freq): def content_right(self, freq):
rep = re.sub(' +', ' ', self.representation.strip()) rep = re.sub(' +', ' ', self.representation.strip())