Moved converter specifications to constructor

This commit is contained in:
cyp
2021-09-10 14:12:04 +02:00
parent f14879f619
commit c078765774
2 changed files with 14 additions and 11 deletions
+5 -2
View File
@@ -198,10 +198,13 @@ class Msd:
class MsdToProperties:
def convert(self, specifications, msd, lemma, properties_language):
def __init__(self, specifications):
self.specifications = specifications
def convert(self, msd, lemma, properties_language):
category_char = msd.code[0].lower()
value_chars = msd.code[1:]
category = specifications.find_category(category_char, msd.language)
category = self.specifications.find_category(category_char, msd.language)
feature_value_list = []
for (index, value_char) in enumerate(value_chars, start=1):
if (value_char != '-'):