- Python 100%
| OCR | ||
| OCR-glossary | ||
| OCR-misc | ||
| OCR-notes | ||
| .env.example | ||
| .gitignore | ||
| CC-1.0-Universal.txt | ||
| CHANGELOG.txt | ||
| ocr-glossary.py | ||
| ocr-misc.py | ||
| ocr-notes.py | ||
| ocr.py | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
Tolkien's Sir Gawain and the Green Knight
This is a project to convert J. R. R. Tolkien's Sir Gawain and the Green Knight to text.
Tolkien did two versions, of SGGK, one in 1925 in the original Middle English, and another decades later that he translated into Modern English.
This project focusses on the Middle English version.
Wikisource
With luck, this present project will be able to contribute to this Wikisource project:
- https://en.wikisource.org/wiki/Index:Sir_Gawain_and_the_Green_Knight_-Tolkien_and_Gordon-_1925.djvu
Sources
The version linked at the Wikisource page is a google digitization. There is a superior version without google encumberances available from archive.org. The versions are identical, both published in 1925. The archive.org version:
The present project will use the version from archive.org to avoid google.
OCR
Setup:
git clone https://spacecruft.org/books/gawain-tolkien
cd gawain-tolkien/
python -m venv venv
source venv/bin/activate
pip install -U setuptools pip wheel
pip install -r requirements.txt
# optionally, to get development dependencies:
pip install -r requirements-dev.txt
cp -p .env.example .env
${EDITOR} .env
python ocr.py
The ocr.py script is set to use Qwen3-VL with Alibaba's cloud,
but should work with any OpenAI compatible endpoint.
License
Public domain.
CC0 1.0 Universal
2025, Jeff Moe