diff options
Diffstat (limited to 'factories')
-rw-r--r-- | factories/INL_factory.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/factories/INL_factory.py b/factories/INL_factory.py index 6b75f28..e52257f 100644 --- a/factories/INL_factory.py +++ b/factories/INL_factory.py @@ -47,6 +47,7 @@ class INLFactory(BasicFactory): name = '' name_in_langs = dict() bio_data = list() + comment_list = list() eng_name = '' date_of_birth = '' #get the names and date of birth and bio data @@ -76,7 +77,9 @@ class INLFactory(BasicFactory): name_in_langs.update({field.text: [name_diff]}) elif tag == 'bio_data': bio_data.append(field.text) - return entities.Person(eng_name, date_of_birth, name_in_langs, bio_data) + elif tag == 'comment': + comment_list.append(field.text) + return entities.Person(eng_name, date_of_birth, name_in_langs, bio_data, comment_list) #110 is institue elif record_key == '110': return entities.Institution() @@ -84,6 +87,7 @@ class INLFactory(BasicFactory): elif record_key == '151': name_in_langs = dict() types_of_place = list() + comment_list = list() for field in raw_object.getroot(): key = field.attrib.get('tag') tag = entity_keys.get(key) @@ -108,7 +112,9 @@ class INLFactory(BasicFactory): name_in_langs.get(field.text).append(name_diff) else: name_in_langs.update({field.text: [name_diff]}) - return entities.Location(eng_name, types_of_place , name_in_langs) + elif tag == 'comment': + comment_list.append(field.text) + return entities.Location(eng_name, types_of_place , name_in_langs, comment_list) else: raise KeyError('Key {} was not recognized for factory {}'.format(entity_keys, type(self))) |