Update 'xppl/getannot.py'

This commit is contained in:
anglk 2019-01-30 20:23:41 +01:00
parent ea25fbcd10
commit ca367e8aab

View File

@ -45,7 +45,7 @@ def get_annot_results(annot, name):
data = { data = {
'text': item['text'], 'text': item['text'],
'extract': item['target'][0]['selector'][2]['exact'], 'extract': item['target'][0]['selector'][2]['exact'],
'title': item['uri'], 'url': item['uri'] 'title': 'try me', 'url': item['uri']
} }
res.append(data) res.append(data)
else: else:
@ -54,7 +54,7 @@ def get_annot_results(annot, name):
data = { data = {
'text': item['text'], 'text': item['text'],
'extract': item['target'][0]['selector'][1]['exact'], 'extract': item['target'][0]['selector'][1]['exact'],
'title': item['document']['title'], 'url': item['uri'] 'title': 'try me', 'url': item['uri']
} }
res.append(data) res.append(data)
return res return res
@ -71,7 +71,7 @@ def get_annot_book(annot, name):
data = { data = {
'text': item['text'], 'text': item['text'],
'extract': item['target'][0]['selector'][2]['exact'], 'extract': item['target'][0]['selector'][2]['exact'],
'title': item['document']['title'], 'url': item['uri'] 'title': 'try me', 'url': item['uri']
} }
res.append(data) res.append(data)
else: else:
@ -80,7 +80,7 @@ def get_annot_book(annot, name):
data = { data = {
'text': item['text'], 'text': item['text'],
'extract': item['target'][0]['selector'][1]['exact'], 'extract': item['target'][0]['selector'][1]['exact'],
'title': item['document']['title'], 'url': item['uri'] 'title': 'try me', 'url': item['uri']
} }
res.append(data) res.append(data)
return res return res