no more structureselection enum

This commit is contained in:
Ozbolt Menegatti 2019-05-17 20:45:10 +02:00
parent d2f1e95a8f
commit 111512a901

12
wani.py
View File

@ -132,10 +132,6 @@ class Rendition(Enum):
Lexis = 2 Lexis = 2
Unknown = 3 Unknown = 3
class StructureSelection(Enum):
All = 0
Msd = 1
class Order(Enum): class Order(Enum):
FromTo = 0 FromTo = 0
ToFrom = 1 ToFrom = 1
@ -195,9 +191,10 @@ class ComponentRendition:
elif 'selection' in feature: elif 'selection' in feature:
if feature['selection'] == "msd": 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": elif feature['selection'] == "all":
self._set_more(StructureSelection.All) self._set_more("all")
else: else:
raise NotImplementedError("Representation selection: {}".format(feature)) raise NotImplementedError("Representation selection: {}".format(feature))
@ -240,7 +237,7 @@ class ComponentRendition:
# set correct type first # set correct type first
if type(representations[w_id][1]) is str: if type(representations[w_id][1]) is str:
representations[w_id] = ( 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) representations[w_id][0].append(w.text)
@ -568,7 +565,6 @@ class SyntacticStructure:
self.lbs = None self.lbs = None
self.agreements = [] self.agreements = []
self.components = [] self.components = []
self.selection = StructureSelection.All
@staticmethod @staticmethod
def from_xml(xml): def from_xml(xml):