Skip to content

feat: link page numbers to the paper dictionaries' scans on archive.org - #65

Merged
forzagreen merged 1 commit into
mainfrom
feat/archive-org-page-links
Oct 16, 2026
Merged

forzagreen merged 1 commit into
mainfrom
feat/archive-org-page-links

Conversation

@forzagreen

Copy link
Copy Markdown
Owner

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):

Column Source Meaning
archive_org_url Wikidata P953 ("full work available at URL") the archive.org scan, bare (https://archive.org/details/<item>, or …/<item>/<file> for one volume of a multi-volume item)
page_offset Wikidata P8330 ("file page offset") printed page p is page p + page_offset of the file

Link 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

  • 45 dictionaries get archive_org_url; 44 also get page_offset (theatre_language has a scan but no page numbers).
  • 40 of the 46 dictionaries with page numbers now link their pages. The 6 others have no archive.org scan: at_petroleum, at_remote_sensing, at_veterinary_medicine, at_gross_anatomy, ta3din (no P953; archive.org searched, nothing matching the edition) and aala_interdisciplinary_linguistics (P953 is a PDF on aala.dz).
  • Every offset was checked against the scan's OCR (_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).
  • A few scans drift by a few pages in part of the book (missing or extra sheets): 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 / _3 renumbered 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 validate gains three checks (none violated): archive_org_url is a bare archive.org/details/ URL; no page_offset without a scan; a dictionary with a scan and page numbers has a page_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.

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.
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

Successfully merging this pull request may close these issues.

1 participant