From 111512a9013f688f2c8171bf87b3c7c965e188f3 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Fri, 17 May 2019 20:45:10 +0200 Subject: [PATCH] no more structureselection enum --- wani.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/wani.py b/wani.py index 0b3f26a..8ec18d1 100644 --- a/wani.py +++ b/wani.py @@ -132,10 +132,6 @@ class Rendition(Enum): Lexis = 2 Unknown = 3 -class StructureSelection(Enum): - All = 0 - Msd = 1 - class Order(Enum): FromTo = 0 ToFrom = 1 @@ -195,9 +191,10 @@ class ComponentRendition: elif 'selection' in feature: if feature['selection'] == "msd": - self._set_more(StructureSelection.Msd) + selectors = {k: v for k, v in feature.items() if k != 'selection'} + self._set_more(selectors) elif feature['selection'] == "all": - self._set_more(StructureSelection.All) + self._set_more("all") else: raise NotImplementedError("Representation selection: {}".format(feature)) @@ -240,7 +237,7 @@ class ComponentRendition: # set correct type first if type(representations[w_id][1]) is str: representations[w_id] = ( - [], render_all if rep.more is StructureSelection.All else render_form + [], render_all if rep.more == "all" else render_form ) representations[w_id][0].append(w.text) @@ -568,7 +565,6 @@ class SyntacticStructure: self.lbs = None self.agreements = [] self.components = [] - self.selection = StructureSelection.All @staticmethod def from_xml(xml):