Skip to content

Commit

Permalink
fixed source cmd returns location with duplicate URI schemes when the…
Browse files Browse the repository at this point in the history
… scheme is passed as a part of location string
  • Loading branch information
keighrim committed Jul 15, 2024
1 parent c7b6ff5 commit 36cf199
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clams/mmif_utils/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def generate_source_mmif_from_file(documents, prefix=None, scheme='file', **igno
location = prefix / location
doc = Document()
doc.at_type = at_types[mime.split('/', maxsplit=1)[0]]
doc.properties.location = f"{location_uri.scheme}://{location}"
doc.properties.location = f"{location_uri.scheme}://{location if not location.startswith(location_uri.scheme) else location[len(location_uri.scheme)+3:]}"
doc.properties.id = f'd{doc_id}'
doc.properties.mime = mime
pl.add_document(doc)
Expand Down

0 comments on commit 36cf199

Please sign in to comment.