Search several book indexes
Find every indexed occurrence of a word or number across a collection of scans. The CSV gives the index filename, physical page, original OCR spelling, surrounding OCR line and word rectangle. You can run the search offline with Python 3.10 or later and the standard library.
Try the plumbing catalogue
Extract the Folio Find offline ZIP and run this command in its folio-find folder.
python tools/concordance.py brass assets/calahan.archive.folio.jsonl -o brass.csv
The included index returns seven occurrences on physical pages 15, 16, 18 and 24. On page 24 the OCR line begins “Brass (nickel-plated) plate”. To inspect the print, open the Calahan PDF in the reader, load its matching index and search brass on page 24. PDF and index downloads.
Search your books
In Folio Find, save an image OCR index after searching your PDF, or prepare an archive index using the archive converter. Pass the local index filenames together. Only the saved text and rectangles are read. The PDFs can stay on another drive.
python tools/concordance.py brass "books/first.folio.jsonl" "books/second.folio.jsonl" -o collection.csv
Choose a new filename for each export. Omit -o to write UTF-8 CSV to standard output. The terminal reports the hit count and indexed page coverage for each input, including books with zero hits. With a partial index, the remaining pages still need OCR. All indexes are validated before the tool emits results.
Read the results
The command accepts one complete OCR word or number. It ignores capitalization and outer punctuation and normalizes Unicode compatibility forms. An internal hyphen or decimal point is significant. The recognized_text and line fields preserve the original OCR.
The CSV follows input file order and the page records within each file. hit_on_page starts at one for each page. source distinguishes archive-djvu and image-ocr. Two indexes for the same PDF can each report the same printed occurrence. Use index_file and pdf_sha256 to trace a row back to its edition and OCR source.
The page field counts physical sheets starting at one. left, top, right and bottom are fractions of the displayed page from its top left. Multiply horizontal coordinates by the display width and vertical coordinates by its height.