個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
Chinese → Vietnamese novel translation site using the VietPhrase technique
(dictionary-based phrase substitution), with a readability layer on top and
an editable dictionary the user builds up over time.檢視完整 README ↗Chinese → Vietnamese novel translation site using the VietPhrase technique (dictionary-based phrase substitution), with a readability layer on top and an editable dictionary the user builds up over time.
The Next.js app is scaffolded and has one working end-to-end feature: the
translate page (/translate), which posts Chinese text to
/api/translate and gets back a VietPhrase translation from
packages/tokenizer reading data/seed/dictionary_seed.db directly. This
was verified to reproduce a real sangtacviet.com sample translation
exactly. The reading library (book URL → chapters → lazy scrape-on-view)
and the Postgres/Prisma backend are still design-only — see
docs/DICTIONARY_SOURCES.md for how the seed dictionary was built,
docs/VIETPHRASE_CORE.md for how the translation engine itself works, and
docs/ARCHITECTURE.md for how the site's three features (reading library,
"live scrape/surf", translate page) fit together as one pipeline, and
docs/ENVIRONMENT.md for the exact Python/Node/npm versions this runs on
— all written before the app exists so none of it gets lost.
Read docs/ENVIRONMENT.md before assuming anything here "just works":
most of this repo was built and tested through a bridged environment
running different Node/Python versions than the real target machine —
that doc explains exactly what's unverified and how to check it.
npm install
npm run dev
Then visit http://localhost:3000/translate and paste Chinese text in the
input box to get a VietPhrase translation — this reads
data/seed/dictionary_seed.db directly via packages/tokenizer, no
database setup required for this page.
The home page (/) is the reading library: paste a book's chapter-list
URL to add it, then click through to read chapters (scraped and
translated lazily, on first view, and cached after). Needs a working
DATABASE_URL/DIRECT_URL in .env (see .env.example) and, if
you're running this through Claude Code Remote's bridged Linux
environment rather than natively, a npx prisma generate re-run to pick
up prisma/schema.prisma's binaryTargets — see "Next up" below.
To run the whole test suite (tokenizer + the scraper's extraction heuristics):
npm test
See "Next up" below for what's implemented vs. still open.
vietphrase-website/
├── data/
│ └── seed/
│ ├── dictionary_seed.db # ready-to-use SQLite seed DB
│ ├── build_dictionary.py # reproducible merge/clean pipeline
│ ├── migrate_split_schema.py # one-time v2->v3 schema migration (see docs)
│ ├── VietPhrase.truyencuatui.txt # raw source (v1)
│ ├── CVDICT.u8 # raw source (v1)
│ └── hanviet-pinyin.csv # raw source (v1)
├── docs/
│ ├── ARCHITECTURE.md # product architecture: how the site's 3 features fit together
│ ├── VIETPHRASE_CORE.md # how the translation engine works (algorithm, open decisions)
│ ├── ENVIRONMENT.md # exact tool versions this runs on, and a version-gap caveat
│ └── DICTIONARY_SOURCES.md # full source evaluation + build report
├── .nvmrc # pins Node to the versions in ENVIRONMENT.md
├── .python-version # pins Python to the versions in ENVIRONMENT.md
├── src/
│ ├── app/ # Next.js App Router: /, /translate, /novels/..., /api/...
│ └── lib/ # Prisma client, tokenizer singleton, scraper + extractors
├── packages/
│ └── tokenizer/ # production tokenizer module (tested, no npm deps)
├── prisma/
│ └── schema.prisma # live-app Postgres schema (forward design, no app yet)
├── prototype/
│ └── tokenizer.mjs # superseded validation script, kept for history only
├── ref/ # vendor reference clones (gitignored, see below)
└── README.md
ref/ isn't included in deliverables — it's ~375 MB of cloned reference
repos used to build the dictionary. See "Reproducing this build yourself" in
docs/DICTIONARY_SOURCES.md for the exact clone commands if you want them
locally too. Everything useful that came out of them is already merged into
dictionary_seed.db, or explicitly called out in the docs as a phase-2
reference (e.g. rule.txt's grammar-rule DSL, LacViet.txt/ThieuChuu.txt
for a future detailed-lookup panel).
| Table | Rows | Notes |
|---|---|---|
words | 1,432,932 | bulk phrase substitutions, rebuilt from source |
names | 276,248 | proper nouns; novel_id nullable (NULL = global; all seed rows are global) |
pronouns | 1,427 | pronoun substitutions, tuned for readability |
hanviet_fallback | 17,564 | single-character Han-Viet reading, last-resort fallback |
scrape_blacklist | 274 | scrape-time text-cleaning patterns |
Schema v3: words / names / pronouns are separate tables, not one
dictionary_entries table with a category column — see
docs/DICTIONARY_SOURCES.md ("Schema v3") for the reasoning. names also
gained novel_id (nullable, for future per-novel name overrides),
is_active, and updated_at, in anticipation of per-story curation once
the app exists.
src/lib/overrides.ts + packages/tokenizer's overrides
Map, see docs/ARCHITECTURE.md "Data split").src/lib/extract/ has the
generic chapter-list/content extractors (26 unit tests against
synthetic HTML, plus structurally validated against two real sites --
book.sfacg.com and 69shuba.com -- see docs/ARCHITECTURE.md "Scraping
strategy"), src/app/api/novels/... has the API routes, and /,
/novels/[slug], /novels/[slug]/chapters/[number] have the UI.
npx prisma generate has been re-run on the real machine with the
added binaryTargets, so the generated client works from both the
real Windows machine and the bridged Linux dev environment.npm run dev, then add
https://book.sfacg.com/Novel/530508/ or https://www.69shuba.com/ book/90442.htm (or any book/chapter URL) through the home page's
add-book form and confirm a chapter reads correctly. If a site's
structure trips up the generic extractor, add a per-site file under
src/lib/sites/ -- see docs/ADDING_A_SITE.md.npx prisma migrate dev +
npx prisma generate have been run on the real machine; typecheck and
lint are clean. See docs/ARCHITECTURE.md "User management and
per-word overrides" for the full design. Still needed: a real
AUTH_SECRET in .env for anything beyond your own machine (a
dev-only one was generated locally; see .env.example), and a manual
end-to-end pass (sign up, edit a word, promote as an editor) since
this assistant's dev environment can't reach Neon directly (same
limitation as the scraping end-to-end test above).rule.txt