Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

index sign doesn't show up in annotated sentences #1305

Open uklomp opened 1 month ago

uklomp commented 1 month ago

Hi @Jetske, I thought you were already working on this but I'm not sure anymore so I also made an issue. In this annotated sentence https://signbank.cls.ru.nl/dictionary/gloss/44092 - the pointing sign is glossed twice and should appear in the annotations but is not there. It concerns glosses like PT-1hand:1

susanodd commented 1 month ago

Maybe related to this?

Q: @Jetske I'm working on #1303 and finally have it showing a list. But this took some time.

It seems the data stored in the model AnnotatedGloss, the field stored in "gloss" is actually an ID, not a foreign key. So an additional lookup is needed to actually retrieve the Gloss object using this ID. (Normally, if you retrieve the value in a foreign key field it should be an object.)

This method doesn't work:

https://github.com/Signbank/Global-signbank/blob/afaa5ce1006d80e60aee8580606469ee8edd8f50/signbank/dictionary/models.py#L3956-L3957

Inside my loop, I have both the annotated gloss (variable this) and the gloss object (this_gloss), and the following:

    this = AnnotatedGloss.objects.get(id=annotatedgloss_id)
    this_gloss = Gloss.objects.get(id=this.gloss_id)

......

    print(this.annotatedsentence)
    print(this.show_annotationidglosstranslation())
    print(this_gloss.annotationidglosstranslation_set.all())

where "this" is an annotated gloss and "this_gloss" is the gloss. The second print does not output anything, but the first and third do.

Jetske commented 1 month ago

@uklomp That is strange because indeed those glosses are given in the list when uploading the file. I'll fix it asap.

Jetske commented 1 month ago

@susanodd that's not directly related so let's discuss in another issue.

Jetske commented 1 month ago

Found the problem. The annotations are sent to the form as "ann1:ann2:ann3;" and when adding them split by ":" so this obviously fails if the gloss contains a ":". I changed it to json format, that should be more robust.

Jetske commented 3 weeks ago

Sorry, this fix was done in the manage sentences branch, so it will be merged hopefully soon when we complete #1314

susanodd commented 1 week ago

The manage annotated sentences is available under the Datasets menu on signbank.