Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

翻譯錯誤 #8

Closed
mitis1233 opened this issue Jul 18, 2019 · 9 comments
Closed

翻譯錯誤 #8

mitis1233 opened this issue Jul 18, 2019 · 9 comments
Labels
BUG臭蟲 Something isn't working

Comments

@mitis1233
Copy link

只、髮 經常翻譯錯誤
這裡有幾個例子 麻煩修正
順便問 如何自訂繁簡轉換的詞彙?

例子:
不是隻有戰鬥用
但是隻過了短短兩年
下場是隻能就讀
其實發色和危險與否並沒有關係
原文:
不是只有战斗用
但是只过了短短两年
下场是只能就读
其实发色和危险与否并没有关系

@bgtsai
Copy link

bgtsai commented Jul 22, 2019

我的猜想是編輯安裝目錄下\opencc\dictionary\的文件
看起來像對照表,可以編輯試試?

可以參考
https://blog.darkthread.net/blog/opencc-conv-customization/

@ThanatosDi
Copy link
Owner

ThanatosDi commented Jul 22, 2019

這個部分的確可以自行在 opencc/dictionary 中修改
詳細要修改的檔案可以查看 opencc/config 中的設定檔
比如說使用 s2t 好了 就可以看到到底這個模式所使用的字典檔是那些,再去opencc/dictionary中修改,或者如 #8 (comment) 所說的用自訂字典的方式修改

"file": "STPhrases.txt"

"file": "STCharacters.txt"

但是比較需要注意的問題是 Python 版本的 OpenCC 有一個 BUG,就是當一個詞有兩種結果只會回傳第一個結果,作者頁面

如果需要非常準確的翻譯結果可以嘗試看看使用 v2.0.0 的繁化姬引擎翻譯看看,只不過因為是使用網路功能需要有網路的環境以及轉換的效率並沒有 OpenCC 來的快速

@mitis1233
Copy link
Author

ver.2.0.0無法使用,用calibre轉檔也一樣,這檔案在ver.1.0.5.2可以正常轉換。

log 記錄檔如下:
2019-07-27 20:49:25,353 EPUB INFO : * function: _read_config, * msg: read config
2019-07-27 20:49:25,353 EPUB INFO : * function: _read_config encoding, * msg: ASCII
2019-07-27 20:49:25,353 EPUB INFO : * function: _read_config, * msg: already read config
engine: zhconvert
converter: Traditional
format: Horizontal
2019-07-27 20:49:25,353 EPUB INFO : * function: convert, * msg: file path: D:\Program Files\EpubConv 2.0.0\冒险者入门篇[简].epub
2019-07-27 20:49:25,494 EPUB ERROR : * function: convert, * msg: File is not a epub file

@ThanatosDi
Copy link
Owner

@mtis1233 我從這邊只能知道程式判斷檔案並非epub格式,epub格式為 application/epub+zip

@mitis1233
Copy link
Author

mimetype是application/epub+zip,檔案格式應該沒錯,我有寄檔案了,希望有幫助

@ThanatosDi
Copy link
Owner

ThanatosDi commented Jul 28, 2019

@mtis1233 恩...我這邊執行結果是正常的捏?

image

如果判斷還是非 epub 檔案
我預計會先釋出 2.0.1 讓程式可以輸出 debug log 這樣也比較好排除

@ThanatosDi
Copy link
Owner

@mtis1233 我嘗試過很多方式還是無法還原你的問題 冏
一開始認為會不會是環境問題 我把 v2.0.1 版本的程式丟給朋友(完全無開發環境) 跟你提供的 epub 一樣可以轉換
接下來猜測作業系統? 防毒軟體? 或者有其他不明因素導致這個狀況發生
如同我回信的內容,照理說不管是怎樣的檔案規格應該都會有檔案格式,但是在debug內容中卻是回傳 None
又或者你執行方式是使用 cli 去呼叫轉換
那如果 epub 路徑中有空白比如說

python app2.py <file path>/example file.epub

在 cli 中會判斷成只執行

python app2.py <file path>/example

如果要完整寫上路徑建議是在檔案路徑前後還是用雙引號框起來

@mitis1233
Copy link
Author

我也找不到原因,win10內建防毒都關了也一樣,可能真的是作業系統bug吧 很久沒更新了。
目前是把self._check(epub_file_path)刪除就能正常運行
下圖:原檔案和刪除後
螢幕擷取畫面 (129)

@ThanatosDi ThanatosDi added the BUG臭蟲 Something isn't working label Aug 10, 2019
@wym3253
Copy link

wym3253 commented Aug 10, 2019

这个bug大概是calibre造成的,我之前安装calibre之后使用程序就会报错,卸载calibre无效,但是重装系统之后程序恢复正常。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG臭蟲 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants