Skip to content

Commit

Permalink
Only pass array to index if annotation has multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
bkis committed Jul 23, 2024
1 parent 64bf91c commit 819b986
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tekst-API/tekst/resources/text_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ def rtype_index_doc_data(
{
"token": token.token or "",
"annotations": {
anno.key: anno.value for anno in token.annotations or []
anno.key: anno.value[0] if len(anno.value) == 1 else anno.value
for anno in token.annotations
},
}
for token in content.tokens
Expand Down

0 comments on commit 819b986

Please sign in to comment.