From 30a5e80569dff3d2c7e7bb030c8922d4df79c71d Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sat, 8 Jun 2019 11:27:51 +0200 Subject: [PATCH] determine polnopomenska-beseda components in structure (for now only type='main') --- wani.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wani.py b/wani.py index 57f2840..80bcd8d 100644 --- a/wani.py +++ b/wani.py @@ -123,6 +123,10 @@ CATEGORY_BASES = { "X": ['.'] * 1 } +class ComponentType(Enum): + Other = 0 + Core = 2 + Core2w = 3 class RestrictionType(Enum): Morphology = 0 @@ -524,6 +528,7 @@ class Component: def __init__(self, info): idx = info['cid'] name = info['name'] if 'name' in info else None + typ = ComponentType.Core if info['type'] == "core" else ComponentType.Other if 'status' not in info: status = ComponentStatus.Required @@ -543,6 +548,7 @@ class Component: self.next_element = [] self.representation = [] self.selection = {} + self.type = typ self.iter_ctr = 0