Repository navigation
feat: link page numbers to the paper dictionaries' scans on archive.org - #65
Merged
Merged
Conversation
Add two columns to `dictionary`, so that a term's printed page can link to that page of the dictionary's scan: - `archive_org_url`: the archive.org scan, from Wikidata's "full work available at URL" (P953); set for the 45 dictionaries that have one - `page_offset`: printed page p is page p + page_offset of the file (Wikidata's "file page offset", P8330); the link is `<archive_org_url>/page/n<p + page_offset - 1>/mode/1up`, as the Cite Q module of ar.wikipedia builds it Every offset was checked against the scan's OCR: each term votes for the scan page whose text contains its English form. The 30 offsets already on Wikidata all agree; the 10 that were missing were inferred this way and added to Wikidata. 40 of the 46 dictionaries with page numbers now link their pages; the 6 others have no archive.org scan. Renumber medical_terms_2 (-238) and medical_terms_3 (-552) to their printed pages: arabterm numbered the three volumes continuously, the printed volumes each start at page 1 (so the ص= of their citations was wrong too). `make validate` checks the new columns, and the website links its page numbers and each dictionary's scan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds what wikitermbase needs to turn a term's "ص. 12" into a link to that page of the dictionary's scan on archive.org (wikitermbase PR to follow, opened as a draft).
Schema
Two new columns on
dictionary(both model files, the migration, README):archive_org_urlhttps://archive.org/details/<item>, or…/<item>/<file>for one volume of a multi-volume item)page_offsetLink to printed page p:
<archive_org_url>/page/n<p + page_offset - 1>/mode/1up, the link that Module:Cite Q on ar.wikipedia builds from the same two Wikidata values.Data
archive_org_url; 44 also getpage_offset(theatre_languagehas a scan but no page numbers).at_petroleum,at_remote_sensing,at_veterinary_medicine,at_gross_anatomy,ta3din(no P953; archive.org searched, nothing matching the edition) andaala_interdisciplinary_linguistics(P953 is a PDF on aala.dz)._hocr_searchtext+_hocr_pageindex): each term votes for the scan page whose text contains its English form. The 30 offsets already on Wikidata all agree. The 10 missing ones were inferred this way and added to Wikidata as P8330 qualifiers: Q116437316, Q116392774, Q116443862, Q132396287, Q124816352, Q112724717, Q131987385 (+1), Q133934820, Q139719120, Q141442356 (all others +0).scs_information_technology(offset 18 → 6 across the book, 12 kept),at_information_tech(36, then 38 from p. 104),at_oceanology(80, then 78 from p. 146). They keep one offset; the link lands near the page.medical_terms_2/_3renumbered to their printed pages (−238 / −552, 7,435 terms): arabterm numbered the three volumes continuously, the printed volumes each start at page 1 (checked against the running headers; Wikidata's P8330 of 6 and 12 agrees). Theص=that wikitermbase puts in citations for these two volumes was wrong until now.Validation
make validategains three checks (none violated):archive_org_urlis a bare archive.org/details/ URL; nopage_offsetwithout a scan; a dictionary with a scan and page numbers has apage_offset.Website
Each dictionary page shows its scan ("النسخة المصوّرة"), and the page column links to the scan page.
Merge order
Merging this sends the dump to wikitermbase (refresh PR). The wikitermbase code PR must be merged after that refresh PR: its search query names the new columns.