diff options
author | gilad_ilsar <gandismidas1> | 2016-09-22 14:13:48 +0300 |
---|---|---|
committer | gilad_ilsar <gandismidas1> | 2016-09-22 14:13:48 +0300 |
commit | e24a4199fc75f9939c488c46aea3d8ff745a6ba8 (patch) | |
tree | 689fb682e26da9c25de272b33c23493c060f3193 /factories/INL_factory.py | |
parent | cc9c0e57d5a23be30a9d0ad5a97acaa01019b573 (diff) |
updates
Diffstat (limited to 'factories/INL_factory.py')
-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))) |