mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-11-28 09:00:23 +08:00
* fix: readme_cht.md * fix: cht qudai, alltoolbuttons.md, apiservice.md * fix: cht qudai * fix: cht embedtranslate.md-emugames_template.md * fix: cht qudai * fix: cht alltoolbuttons.md, embedtranslate.md - index.md * fix: cht index.md - sr.md * fix: qa1.md, sr.md, textprocess.md - yomitan.md * fix: cht `、` to `` * fix: cht title "&" to " & " * fix: cht include json qudai shibie to bianshi * fix: cht windows setting describe * fix: cht del useless space * fix: cht.ts * fix: cht new * fix: cht del useless space * fix: cht huashu youbiao to huashu * fix: cht small * fix: cht `,` to ` ` * fix: dakai to kaiqi * fix: cht small * fix: cht readme * fix: cht `/` to `、` * fix: cht `/` to `、` * fix: cht small error about ... and / * fix: cht final check
2 KiB
2 KiB
網路服務
Web 頁面
-
/page/mainui
與主視窗顯示的文字內容同步
-
/page/transhist
與歷史文字顯示的文字內容同步
-
/page/dictionary
查詢單字頁面。在
/page/mainui中進行點擊單字查詞時會喚出該頁面。 -
/
整合上述三個頁面的一個頁面。在該視窗中的
/page/mainui子區域中進行點擊單字查詞時,不會開啟新的查詞視窗,而是會在目前視窗的/page/dictionary子區域中進行查詞。 -
/page/translate
翻譯介面
-
/page/ocr
OCR 介面
-
/page/tts
TTS 介面
API 服務
HTTP 服務
-
/api/translate
- 必須指定查詢參數
text - 如果指定參數
id(翻譯器的 ID),則會使用該翻譯器進行翻譯,否則會回傳最快的翻譯介面 - 回傳
application/json,包含翻譯器 IDid、名稱name和翻譯結果result
- 必須指定查詢參數
-
/api/dictionary
- 必須指定查詢參數
word - 如果指定參數
id(詞典的 ID),則會回傳該詞典的查詢結果的application/json物件,包含詞典 IDid、詞典名稱name和 HTML 內容result。如果查詢失敗則會回傳一個空的物件 - 否則會查詢所有詞典,回傳
event/text-stream,每個 Event 為一個 JSON 物件,包含詞典 IDid、詞典名稱name和 HTML 內容result
- 必須指定查詢參數
-
/api/mecab
- 必須指定查詢參數
text - 回傳 Mecab 對
text的解析結果
- 必須指定查詢參數
-
/api/tts
- 必須指定查詢參數
text - 回傳音訊的二進制資料
- 必須指定查詢參數
-
/api/ocr
使用 POST 方法,發送 JSON 請求,包含
image欄位,內容為 Base64 編碼的圖像。 -
/api/list/dictionary
列出目前可用的辭書
-
/api/list/translator
列出目前可用的翻譯器
WebSocket 服務
-
/api/ws/text/origin
會持續輸出所有擷取到的原文文字
-
/api/ws/text/trans
會持續輸出所有翻譯結果