Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create and visualize textual notes annotations #162

Open
jacobwegner opened this issue Jul 7, 2023 · 2 comments
Open

Create and visualize textual notes annotations #162

jacobwegner opened this issue Jul 7, 2023 · 2 comments

Comments

@jacobwegner
Copy link
Contributor

jacobwegner commented Jul 7, 2023

e.g. https://beyond-translation.perseus.org/reader/urn:cts:engLit:mds822-32.tpsthl-1599.pdl-eng:1-6?mode=commentaries

image

Assumes:

  • A tokenized version of the underlying base text (e.g. mds822-32.tpsthl-1599.pdl-eng.txt *
  • A file similar to text_annotations_mds822-32.tpsthl-1599.pdl-eng.json.
  • The file should have an array of commentary objects with each commentary object having the following properties:
    • references ties the passage to the annotation
    • fragment is the value to show in the textual notes widget list ("live with mee" in the screenshot above)
    • commentary is the HTML to be displayed (<span>If thou wilt live</span>)
    • ve_refs is an array of the token ve_ref values (used for the highlighting functionality when the "Textual Notes" display mode is activated)
    • idx as a zero-based index. This will be used for sorting each "commentary" / textual note in the textual notes widget list
    • urn is the URN for each commentary object (e.g. urn:cite2:beyond-tranlsation:commentary.atlas_v1:amedsaid1831-dw042.1)
    • witnesses as an array with
      • value as the abbreviated value, e.g. Rs
      • label as the witness label, e.g. MS Rodenbach

* We can use these instructions to generate a CSV similar to https://gist.github.com/jacobwegner/3a96e1763b7bc22d827680db1351a377)

@jacobwegner
Copy link
Contributor Author

@jchill-git I've left some breadcrumbs above; there are a few more things I'd like to surface as documentation on other features supported by the widget or to simplify things (one example being that we could have a "default" witness if we don't have multiple "sources").

These annotations would be loaded via the scaife_viewer.atlas.importers.text_annotations.import_text_annotations pipeline in settings.SV_ATLAS_INGESTION_PIPELINE or via:

# assumes python manage.py shell_plus

from scaife_viewer.atlas.importers.text_annotations.import_text_annotations
import_text_annotations(reset=True)

@jacobwegner
Copy link
Contributor Author

(I think longer term we may have a commentary / textual notes-specific pipeline and annotation format, but what we have should work ok)

I'd mentioned that the "fragment" might be required for matching; I think it is best to have it be the same thing as the "value" of any of the tokens in ve_ref, but it is not required here. It is required for an variant of the CommentaryWidget used in Scaife Viewer 1, but not for Beyond Translation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant