Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def refextract_text():
"""Run refextract on a piece of text."""
with local_refextract_kbs_path() as kbs_path:
extracted_references = extract_references_from_string(
request.json['text'],
override_kbs_files=kbs_path,
reference_format=u'{title},{volume},{page}'
)
references = map_refextract_to_schema(extracted_references)
references = match_references(references)
return jsonify(references)
def extract_references_from_text(text, source=None, custom_kbs_file=None):
"""Extract references from text and return in INSPIRE format."""
with local_refextract_kbs_path() as kbs_path:
extracted_references = extract_references_from_string(
text,
override_kbs_files=kbs_path,
reference_format=u'{title},{volume},{page}',
)
return map_refextract_to_schema(extracted_references, source=source)