From d83d619dc0f66823d5b622f8f5559a6a9e9e8269 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sat, 8 Jun 2019 11:19:40 +0200 Subject: [PATCH] removing old __str__ and __repr__ debugging code --- wani.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/wani.py b/wani.py index 985f3aa..822e3f2 100644 --- a/wani.py +++ b/wani.py @@ -415,14 +415,6 @@ class ComponentStatus(Enum): Required = 1 Forbidden = 2 - def __str__(self): - if self == ComponentStatus.Optional: - return "?" - elif self == ComponentStatus.Required: - return "!" - else: #Forbidden - return "X" - def get_level(restriction): for feature in restriction: @@ -527,12 +519,6 @@ class Restriction: return self.matcher(match_to) - def __str__(self): - return "({:s} {})".format(str(self.type).split('.')[1], self.present) - - def __repr__(self): - return str(self) - class Component: def __init__(self, info): @@ -603,25 +589,6 @@ class Component: def name_str(self): return "_" if self.name is None else self.name - def __str__(self): - n = self.name_str() - return "{:s}) {:7s}:{} [{}] :{}".format( - self.idx, n, self.status, self.restriction, self.representation) - - def tree(self): - el = [] - for next, link, order in self.next_element: - s = "{:3} -- {:5} --> {:3}".format(self.idx, link, next.idx) - if order != Order.Any: - s += " " + str(order)[6:] - - el.append(s) - el.extend(next.tree()) - return el - - def __repr__(self): - return str(self) - def match(self, word): m1 = self._match_self(word) if m1 is None: @@ -765,13 +732,6 @@ class SyntacticStructure: continue forms[n].append(to_add) - def __str__(self): - comp_str = "\n".join(str(comp) for comp in self.components) - links_str = "\n".join(self.components[0].tree()) - - return "{} LBS {}\nCOMPONENTS\n{}\n\nLINKS\n{}\n{}".format( - self.id, self.lbs, comp_str, links_str, "-" * 40) - def get_component(self, idx): for c in self.components: if c.idx == idx: