def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Parameter: res.update( SemanticField=item.semantic_field.name, SemanticCategory=item.semantic_category, IDS_code=item.ids_code, TypicalContext=item.typical_context, CoreList=item.core_list, BorrowedScore=item.borrowed_score, AgeScore=item.age_score, SimplicityScore=item.simplicity_score, ) if model == Value: res['Word_ID'] = item.word.id res.update({p: item.word.jsondata.get(p) or '' for p in props}) res.update( Source=[item.valueset.contribution.id], BorrowedScore=item.word.borrowed_score, AgeScore=item.word.age_score, SimplicityScore=item.word.simplicity_score, Borrowed=item.word.borrowed, Analyzability=item.word.analyzability, Age=item.word.age.unitdomainelement.name if item.word.age else None, ContactSituation=item.word.contact_situation.unitdomainelement.name if item.word.contact_situation else None, ) return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Value: res['Example_IDs'] = [ sa.sentence.id for sa in item.sentence_assocs ] return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Parameter: res.update( SemanticField=item.semantic_field.name, SemanticCategory=item.semantic_category, IDS_code=item.ids_code, TypicalContext=item.typical_context, CoreList=item.core_list, BorrowedScore=item.borrowed_score, AgeScore=item.age_score, SimplicityScore=item.simplicity_score, ) if model == Value: res['Word_ID'] = item.word.id res.update({p: item.word.jsondata.get(p) or '' for p in props}) res.update( Source=[item.valueset.contribution.id], BorrowedScore=item.word.borrowed_score, AgeScore=item.word.age_score, SimplicityScore=item.word.simplicity_score, Borrowed=item.word.borrowed, Analyzability=item.word.analyzability, Age=item.word.age.unitdomainelement.name if item.word.age else None, ContactSituation=item.word.contact_situation.unitdomainelement. name if item.word.contact_situation else None, ) return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Language: res['Macroarea'] = item.macroarea res['Family'] = item.family return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == DomainElement: res['ID'] = res['ID'].replace('N/A', 'NA').replace('?', 'NN') if model == Value: res['Code_ID'] = res['Code_ID'].replace('N/A', 'NA').replace('?', 'NN') return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Value: res['transcription'] = item.word.description res['alt_form'] = item.word.alt_name res['alt_transcription'] = item.word.alt_description res['Source'] = [r.source.id for r in item.valueset.contribution.references] if model == Parameter: res['Concepticon_ID'] = item.concepticon_id return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Language: res.update(Genus=item.genus.name) return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Value: res['Example_IDs'] = [sa.sentence.id for sa in item.sentence_assocs] return res
def convert(self, model, item, req): res = CldfConfig.convert(self, model, item, req) if model == Value: res['Loan'] = item.loan res['Source'] = [s.id for s in item.valueset.language.sources] return res