[{"data":1,"prerenderedAt":470},["ShallowReactive",2],{"content-\u002Fplugins\u002Faio-epub-translate\u002Faio-epub-analyze":3,"children-\u002Fplugins\u002Faio-epub-translate\u002Faio-epub-analyze":469,"twin-\u002Fplugins\u002Faio-epub-translate\u002Faio-epub-analyze":464},{"id":4,"title":5,"author":6,"body":7,"budget_tier":6,"build_tags":6,"created":6,"description":460,"document_type":461,"extension":462,"game":6,"install":36,"investment_tier":6,"league":6,"meta":463,"navigation":464,"patch":6,"path":465,"plugin":24,"profit_per_hour":6,"ratings":6,"seo":466,"skills_count":6,"status":6,"stem":467,"strategy_tier":6,"tags":6,"updated":6,"version":6,"weight":6,"__hash__":468},"content\u002Fplugins\u002Faio-epub-translate\u002Faio-epub-analyze.md","aio-epub-analyze",null,{"type":8,"value":9,"toc":446},"minimark",[10,37,42,45,56,61,71,75,80,86,90,93,99,103,106,111,128,132,135,214,223,227,241,245,248,296,300,311,315,318,324,328,331,337,349,353,356,364,368,420],[11,12,13],"blockquote",{},[14,15,16,17,25,26,25,30,33,34],"p",{},"From plugin ",[18,19,21],"a",{"href":20},"\u002Fplugins\u002Faio-epub-translate",[22,23,24],"strong",{},"aio-epub-translate"," · ",[27,28,29],"code",{},"v4.0.0",[22,31,32],{},"Install:"," ",[27,35,36],{},"\u002Fplugin install aio-epub-translate@aiocean-plugins",[38,39,41],"h1",{"id":40},"epub-analyze-pre-translation-intelligence","EPUB Analyze — Pre-translation Intelligence",[14,43,44],{},"Phân tích sách TRƯỚC khi dịch: nhận diện nhân vật, writing style, tone, key terms → tạo guideline + glossary chính xác.",[11,46,47],{},[14,48,49,52,53,55],{},[22,50,51],{},"Khi nào dùng",": LUÔN chạy trước ",[27,54,24],{}," cho sách mới. Guideline từ phân tích thực tế tốt hơn hẳn template tự động.",[57,58,60],"h2",{"id":59},"api-setup","API Setup",[62,63,69],"pre",{"className":64,"code":66,"language":67,"meta":68},[65],"language-python","import json, urllib.request, os\n\nBASE = \"https:\u002F\u002Fread-api.aiocean.dev\u002FListBooks.v1.BookService\"\nKEY = os.environ.get(\"AIO_EPUB_API_KEY\", \"duocnv\")\n\ndef api(method, body):\n    data = json.dumps(body).encode('utf-8')\n    req = urllib.request.Request(f\"{BASE}\u002F{method}\", data=data, headers={\n        \"Content-Type\": \"application\u002Fjson\",\n        \"X-License-Key\": KEY\n    })\n    with urllib.request.urlopen(req) as resp:\n        return json.loads(resp.read())\n","python","",[27,70,66],{"__ignoreMap":68},[57,72,74],{"id":73},"workflow","Workflow",[76,77,79],"h3",{"id":78},"_1-lấy-thông-tin-sách-toc-và-thống-kê","1. Lấy thông tin sách, TOC, và thống kê",[62,81,84],{"className":82,"code":83,"language":67,"meta":68},[65],"book = api(\"GetBook\", {\"bookId\": BOOK_ID})\nb = book[\"book\"]\nprint(f\"Title: {b['title']}\")\nprint(f\"Author: {b['author']}\")\nprint(f\"Language: {b['language']}\")\n\n# Book stats — word count, chapter sizes\nstats = api(\"GetBookStats\", {\"bookId\": BOOK_ID})\nprint(f\"Chapters: {stats['totalChapters']}\")\nprint(f\"Total words: {stats['totalOriginalWords']}\")\nprint(f\"Longest: {stats['longestChapter']['filePath']} ({stats['longestChapter']['wordCount']} words)\")\nprint(f\"Shortest: {stats['shortestChapter']['filePath']} ({stats['shortestChapter']['wordCount']} words)\")\n\ntoc = api(\"GetTableOfContent\", {\"bookId\": BOOK_ID})\nchapters = []\ndef collect_chapters(items):\n    for item in items:\n        if item.get(\"filePath\"):\n            chapters.append(item)\n        if item.get(\"children\"):\n            collect_chapters(item[\"children\"])\ncollect_chapters(toc[\"tableOfContent\"][\"items\"])\nprint(f\"Total chapters in TOC: {len(chapters)}\")\n",[27,85,83],{"__ignoreMap":68},[76,87,89],{"id":88},"_2-sample-chapters-đầu-giữa-cuối","2. Sample chapters — đầu, giữa, cuối",[14,91,92],{},"Đọc 3-5 chapters mẫu đại diện cho toàn bộ sách:",[62,94,97],{"className":95,"code":96,"language":67,"meta":68},[65],"# Chọn chapters mẫu: đầu, 1\u002F3, giữa, 2\u002F3, cuối\nsample_indices = [0]\nif len(chapters) > 4:\n    sample_indices += [len(chapters)\u002F\u002F4, len(chapters)\u002F\u002F2, 3*len(chapters)\u002F\u002F4]\nsample_indices.append(len(chapters) - 1)\nsample_indices = sorted(set(sample_indices))\n\n# Dùng BatchGetPageJson để lấy tất cả mẫu trong 1 call\nsample_paths = [chapters[i][\"filePath\"] for i in sample_indices]\nbatch = api(\"BatchGetPageJson\", {\n    \"bookId\": BOOK_ID,\n    \"filePaths\": sample_paths,\n    \"filter\": \"CONTENT_FILTER_ALL\"\n})\n\nsamples = {}\nfor ch_data in batch.get(\"chapters\", []):\n    fp = ch_data[\"filePath\"]\n    samples[fp] = {\n        \"contents\": ch_data[\"contents\"]\n    }\n    print(f\"  {fp}: {ch_data['totalItems']} items\")\n",[27,98,96],{"__ignoreMap":68},[76,100,102],{"id":101},"_3-agent-phân-tích-nội-dung","3. Agent phân tích nội dung",[14,104,105],{},"Đọc nội dung các chapter mẫu và phân tích theo các tiêu chí sau:",[107,108,110],"h4",{"id":109},"a-nhận-diện-thể-loại","A. Nhận diện thể loại",[112,113,114,118],"ul",{},[115,116,117],"li",{},"Self-help \u002F Business \u002F Fiction \u002F Science \u002F Philosophy \u002F Children's \u002F Historical \u002F Technical?",[115,119,120,121,124,125],{},"Ảnh hưởng chiến lược dịch: xem ",[27,122,123],{},"aio-epub-vn-style"," → ",[27,126,127],{},"genre-strategies.md",[107,129,131],{"id":130},"b-danh-sách-nhân-vật-đại-từ","B. Danh sách nhân vật + đại từ",[14,133,134],{},"Với mỗi nhân vật xuất hiện, xác định:",[136,137,138,160],"table",{},[139,140,141],"thead",{},[142,143,144,148,151,154,157],"tr",{},[145,146,147],"th",{},"Nhân vật",[145,149,150],{},"Vai trò",[145,152,153],{},"Đại từ gốc",[145,155,156],{},"Đại từ Việt",[145,158,159],{},"Ghi chú",[161,162,163,181,198],"tbody",{},[142,164,165,169,172,175,178],{},[166,167,168],"td",{},"Elizabeth",[166,170,171],{},"Nhân vật chính, nữ",[166,173,174],{},"she\u002Fher",[166,176,177],{},"cô\u002Fnàng",[166,179,180],{},"Trẻ, mạnh mẽ",[142,182,183,186,189,192,195],{},[166,184,185],{},"Mr. Darcy",[166,187,188],{},"Nhân vật chính, nam",[166,190,191],{},"he\u002Fhim",[166,193,194],{},"anh\u002Fchàng",[166,196,197],{},"Lạnh lùng, quý tộc",[142,199,200,203,206,208,211],{},[166,201,202],{},"Mrs. Bennet",[166,204,205],{},"Mẹ Elizabeth",[166,207,174],{},[166,209,210],{},"bà",[166,212,213],{},"Lớn tuổi, lo lắng",[14,215,216,217,124,219,222],{},"Tham khảo bảng đại từ trong ",[27,218,123],{},[27,220,221],{},"word-choice.md"," (8-cell pronoun table).",[107,224,226],{"id":225},"c-writing-style-tone","C. Writing style & tone",[112,228,229,232,235,238],{},[115,230,231],{},"Formal \u002F Informal \u002F Academic \u002F Conversational \u002F Poetic?",[115,233,234],{},"Narrator voice: first-person \u002F third-person \u002F omniscient?",[115,236,237],{},"Sentence length: short & punchy \u002F long & complex \u002F mixed?",[115,239,240],{},"Đặc trưng riêng của tác giả (metaphors, humor, irony, rhetorical questions)?",[107,242,244],{"id":243},"d-key-terms-concepts","D. Key terms & concepts",[14,246,247],{},"Liệt kê thuật ngữ quan trọng xuất hiện nhiều lần:",[136,249,250,266],{},[139,251,252],{},[142,253,254,257,260,263],{},[145,255,256],{},"Term (EN)",[145,258,259],{},"Đề xuất (VI)",[145,261,262],{},"Lý do chọn",[145,264,265],{},"Tần suất",[161,267,268,282],{},[142,269,270,273,276,279],{},[166,271,272],{},"mindfulness",[166,274,275],{},"chánh niệm",[166,277,278],{},"Thuật ngữ Phật giáo quen thuộc",[166,280,281],{},"cao",[142,283,284,287,290,293],{},[166,285,286],{},"resilience",[166,288,289],{},"sức bền bỉ",[166,291,292],{},"Thuần Việt, tránh \"khả năng phục hồi\"",[166,294,295],{},"trung bình",[107,297,299],{"id":298},"e-độ-khó-dịch","E. Độ khó dịch",[112,301,302,305,308],{},[115,303,304],{},"Ước tính: Dễ \u002F Trung bình \u002F Khó \u002F Rất khó",[115,306,307],{},"Yếu tố gây khó: wordplay, cultural references, poetry, technical jargon?",[115,309,310],{},"Chapters nào khó nhất? Tại sao?",[76,312,314],{"id":313},"_4-tạo-guideline-từ-phân-tích","4. Tạo guideline từ phân tích",[14,316,317],{},"Dựa trên kết quả phân tích, tạo guideline chi tiết:",[62,319,322],{"className":320,"code":321,"language":67,"meta":68},[65],"# Xem guideline hiện có trước khi ghi đè\nexisting = api(\"GetGuideline\", {\"bookId\": BOOK_ID})\nif existing.get(\"guideline\"):\n    print(\"=== EXISTING GUIDELINE ===\")\n    print(existing[\"guideline\"])\n    print(\"\\n→ Merge với kết quả phân tích mới, KHÔNG ghi đè nếu guideline cũ có thông tin tốt.\")\n\nguideline = \"\"\"\n# Translation Guideline — {book_title}\n\n## Thể loại: {genre}\n\n## Phong cách dịch\n- Tone: {tone_description}\n- Giọng kể: {narrator_voice}\n- Nhịp câu: {sentence_rhythm}\n\n## Nhân vật & Đại từ\n{character_table}\n\n## Thuật ngữ cố định\n{glossary_table}\n\n## Nguyên tắc riêng cho sách này\n- {principle_1}\n- {principle_2}\n- {principle_3}\n\n## Lưu ý đặc biệt\n- {special_notes}\n\"\"\"\n\n# Save guideline\napi(\"UpdateGuideline\", {\n    \"bookId\": BOOK_ID,\n    \"guideline\": guideline\n})\nprint(\"Guideline saved!\")\n",[27,323,321],{"__ignoreMap":68},[76,325,327],{"id":326},"_5-lưu-glossary-vào-server","5. Lưu glossary vào server",[14,329,330],{},"Sau khi phân tích key terms, lưu glossary để dùng xuyên suốt quá trình dịch:",[62,332,335],{"className":333,"code":334,"language":67,"meta":68},[65],"# Xem glossary hiện có\nexisting_glossary = api(\"GetGlossary\", {\"bookId\": BOOK_ID})\nprint(f\"Existing terms: {len(existing_glossary.get('entries', []))}\")\n\n# Thêm từng term\napi(\"AddGlossaryTerm\", {\n    \"bookId\": BOOK_ID,\n    \"original\": \"mindfulness\",\n    \"translated\": \"chánh niệm\",\n    \"note\": \"Thuật ngữ Phật giáo, quen thuộc với độc giả Việt\"\n})\n\n# Hoặc thay thế toàn bộ glossary\napi(\"UpdateGlossary\", {\n    \"bookId\": BOOK_ID,\n    \"entries\": [\n        {\"original\": \"self\", \"translated\": \"bản ngã\", \"note\": \"Tâm lý học\"},\n        {\"original\": \"ego\", \"translated\": \"cái tôi\", \"note\": \"Phân biệt với self\"},\n        {\"original\": \"anxiety\", \"translated\": \"lo âu\", \"note\": \"Không dùng 'sự lo lắng'\"},\n        {\"original\": \"repression\", \"translated\": \"dồn nén\", \"note\": \"Thuật ngữ phân tâm học\"}\n    ]\n})\nprint(\"Glossary saved!\")\n\n# Xóa term không cần\napi(\"DeleteGlossaryTerm\", {\n    \"bookId\": BOOK_ID,\n    \"original\": \"term_to_remove\"\n})\n",[27,336,334],{"__ignoreMap":68},[11,338,339],{},[14,340,341,344,345,348],{},[22,342,343],{},"Glossary được merge tự động",": Khi dịch (",[27,346,347],{},"GetChapterContext","), server merge glossary thủ công với auto-generated glossary từ translations. Glossary thủ công được ưu tiên khi conflict.",[57,350,352],{"id":351},"output-mẫu","Output mẫu",[14,354,355],{},"Kết quả phân tích nên có dạng:",[62,357,362],{"className":358,"code":360,"language":361},[359],"language-text","📖 Book Analysis: \"Atomic Habits\" by James Clear\n\nGenre: Self-help \u002F Behavioral Psychology\nDifficulty: Trung bình\nTone: Conversational, motivational, evidence-based\n\nCharacters: Không có nhân vật chính (non-fiction)\nNarrator: First-person (tác giả), dùng \"tôi\"\n\nKey Terms (15):\n  habit loop → vòng lặp thói quen\n  cue → tín hiệu\n  craving → khao khát\n  response → phản hồi\n  reward → phần thưởng\n  identity-based habits → thói quen dựa trên bản sắc\n  ...\n\nTranslation Strategy:\n  - Giữ tone conversational, tránh academic\n  - Dịch ví dụ thực tế sát nghĩa, giữ tên riêng\n  - Thuật ngữ khoa học: ưu tiên thuần Việt, ghi chú gốc Anh lần đầu\n  - Câu ngắn, nhịp nhanh — giữ đúng style tác giả\n","text",[27,363,360],{"__ignoreMap":68},[57,365,367],{"id":366},"điều-hướng","Điều hướng",[136,369,370,380],{},[139,371,372],{},[142,373,374,377],{},[145,375,376],{},"Bạn muốn...",[145,378,379],{},"Dùng skill",[161,381,382,391,400,411],{},[142,383,384,387],{},[166,385,386],{},"Bắt đầu dịch sau khi phân tích",[166,388,389],{},[27,390,24],{},[142,392,393,396],{},[166,394,395],{},"Nạp kiến thức dịch văn học",[166,397,398],{},[27,399,123],{},[142,401,402,405],{},[166,403,404],{},"Xem\u002Fchỉnh guideline",[166,406,407,410],{},[27,408,409],{},"aio-epub-manage"," (phần Guidelines)",[142,412,413,416],{},[166,414,415],{},"Quản lý sách",[166,417,418],{},[27,419,409],{},[14,421,422,424,425,124,428,124,431,124,435,124,437,124,440,124,443],{},[22,423,74],{},": ",[27,426,427],{},"aio-epub-setup",[27,429,430],{},"aio-epub-upload",[22,432,433],{},[27,434,5],{},[27,436,24],{},[27,438,439],{},"aio-epub-quality",[27,441,442],{},"aio-epub-review",[27,444,445],{},"aio-epub-export",{"title":68,"searchDepth":447,"depth":447,"links":448},2,[449,450,458,459],{"id":59,"depth":447,"text":60},{"id":73,"depth":447,"text":74,"children":451},[452,454,455,456,457],{"id":78,"depth":453,"text":79},3,{"id":88,"depth":453,"text":89},{"id":101,"depth":453,"text":102},{"id":313,"depth":453,"text":314},{"id":326,"depth":453,"text":327},{"id":351,"depth":447,"text":352},{"id":366,"depth":447,"text":367},"Pre-translation analysis for EPUB books — analyze writing style, characters, tone, and build glossary before translating.","skill","md",{},true,"\u002Fplugins\u002Faio-epub-translate\u002Faio-epub-analyze",{"title":5,"description":460},"plugins\u002Faio-epub-translate\u002Faio-epub-analyze","2sqSdyMn4xePitLKdnsl9Fyfm5bJvYEmf_xRPM77QXY",[],1779712313265]