Hanji — classical Chinese full-text search index (full edition)
This repository is gated. Access is granted per request, after payment.
What you get
hanji-search.db — a SQLite FTS5 database of 1,500 volumes / 147,727 pages of
pre-1900 East Asian books written in classical Chinese (Chinese woodblock editions,
Korean hanmun, Japanese kanbun), plus:
hanji.py— a zero-dependency CLI (Python standard library only)SCHEMA.md— the table layout so you can query it directly
Why this is not just "OCR text in a database"
Two traps make Chinese full-text search on this kind of corpus silently useless:
- SQLite's
trigramtokenizer returns 0 hits for any CJK query shorter than three characters — which is most Chinese words. The table has rows, the query returns nothing, and no error is raised. (The index I started from had 197,485 rows and returned 0 for傷寒.) - This OCR text mixes traditional and simplified forms, so searching
傷寒misses pages recognised as伤寒.
This database normalises traditional→simplified at both index and query time, and matches multi-character queries as adjacent phrases rather than bag-of-characters.
Measured on the shipped data:
| query | matching pages |
|---|---|
傷寒 |
5,214 |
伤寒 |
5,214 |
本草綱目 |
13 |
ZZZQQQ |
0 |
How to get access
- Request access on this page (the button appears because the repo is gated).
- Pay. The price is USDC 199 on Base (
eip155:8453) to0xbf7B81D521E1E0914b211793C700194F4F11f83e, or the equivalent on Tempo mainnet (chain 4217, USDC.e0x20C000000000000000000000b9537d11c60E8b50). - Open a Discussion on the free sample dataset (DreamGuestAI/hanji-classical-chinese-ocr) with the transaction hash. I approve within 24h.
Want to check the quality first? The free sample (18 volumes / 944 pages) and a browser-based searchable demo are here:
- Dataset: https://huggingface.co/datasets/DreamGuestAI/hanji-classical-chinese-ocr
- Live demo: https://dreamguestai-hanji-demo-static.static.hf.space
Not sure it fits? Ask in the Discussion for a free one-volume excerpt of whatever you actually need. If it is in the corpus, I will add it to the free sample.
Licence and terms
- Source scans are public-domain editions (Ming and earlier)
- The OCR text layer and the index are licensed for research and commercial use by the licensee
- Redistribution as a competing corpus or index is not permitted
- No warranty of accuracy: this is OCR with post-correction, not a human-collated critical edition. Clean printed pages are good; damaged, handwritten or heavily annotated pages are weaker.
Coverage
- Chinese medical classics: 傷寒論, 本草綱目, 脈經, 萬病回春, 醫籍考
- Korean hanmun: 東醫寶鑑, 東國輿地勝覽
- Japanese kanbun: 康治本傷寒論, 吉益東洞 補正輯光傷寒論
- Daoist: 正統道藏 (1445 Ming imperial edition), ritual and divination
- Ming–Qing drama librettos, law, craft manuals
中文说明
本仓库为门控数据集:需申请,付款后由我审批放行。
内容:1,500 卷 / 147,727 页古典汉文古籍的 SQLite 全文检索库(字符级 FTS + 繁简归一),
附零依赖 CLI 与表结构说明。实测 傷寒 与 伤寒 均返回 5,214 页。
获取方式:在本页申请访问 → 支付 USDC 199(Base 链),把交易哈希发到免费样品数据集的 Discussion → 24 小时内放行。
- Downloads last month
- 14