Thursday, December 28, 2017

OpenCC 1.0.5 Windows 32/64版 + AutoHotkey GUI版



中文簡繁轉換開源項目,支持詞彙級別的轉換、異體字轉換和地區習慣用詞轉換(中國大陸、臺灣、香港)。





線上版 http://opencc.byvoid.com/

已編譯好的 Windows 版
32位元
opencc-1.0.5-win32.zip
> https://www.solidfiles.com/v/Y8V2WQ343K7PM

64位元
opencc-1.0.5-win64.zip
https://www.solidfiles.com/v/kGA3RwyLzj6nn

AutoHotkey GUI 版
支緩批量檔案轉換


OpenCC GUI 1.0.0 AutoHotkey 腳本源碼

;
; OpenCC GUI (AutoHotkey Version)
;
; Created on 28-12-2017
;
; Coded by SeIsland
;
; Version 1.0.0
;
; Posted on puresoftapps.blogspot.com
;

#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
Loop %A_WorkingDir%\*.json

json .= (( json <> "" ) ? "|" : "" ) A_LoopFileName

Gui Add, Text, x16 y16 w120 h23 +0x200, Input Folder
Gui Add, Edit, vinput_path x16 y48 w340 h21
Gui Add, Button, gInputBrowse x376 y48 w80 h23, Browse
Gui Add, Text, x16 y80 w120 h23 +0x200, Output Folder
Gui Add, Edit, voutput_path x16 y120 w340 h21
Gui Add, Button, gOutputBrowse x376 y120 w80 h23, Browse
Gui Add, Text, x16 y160 w120 h23 +0x200, Configurations
Gui Add, DropDownList, vjsonselected x144 y160 w91, %json%
Gui Add, Button, gConvert x376 y160 w80 h23, Convert

Gui Show, w479 h205, OpenCC GUI (AutoHotkey Version)
Return

InputBrowse:
FileSelectFolder, input_path,,, Select Input Folder
GuiControl,, input_path, %input_path%
Return
OutputBrowse:
FileSelectFolder, output_path,,, Select Output Folder
GuiControl,, output_path, %output_path%
Return

Convert:
GuiControlGet, input_path
GuiControlGet, output_path
GuiControlGet, jsonselected
If (input_path="")
{
MsgBox,, Error, Input directory is not set.
Return
}
else if !FileExist(input_path)
{
MsgBox,, Error, Input directory is not found.
Return
}
If (output_path="")
{
MsgBox,, Error, Output directory is not set.
Return
}
If (jsonselected="")
{
MsgBox,, Error, Configuration is not set.
Return
}
Loop Files, %input_path%\*.*, R
{
StringReplace, output_filepath, A_LoopFileFullPath, %input_path%, %output_path%, A
StringReplace, output_subfolder_path, output_filepath, \%A_LoopFileName%,, A
FileCreateDir, %output_subfolder_path%
Progress, %a_index%, %a_loopfilename%, Converting..., Progress
runwait, opencc.exe "-i" "%A_LoopFileFullPath%" "-o" "%output_filepath%" "-c" "%jsonselected%", %A_WorkingDir%, Hide
Sleep, 50
}
Progress, off
return


GuiEscape:
GuiClose:
ExitApp


Usage:

Open Chinese Convert (OpenCC) Command Line Tool

Usage: opencc.exe [--noflush ] [-i ] [-o ] [-c ] [--] [--version] [-h]

Options:

--noflush
Disable flush for every line

-i , --input
Read original text from .

-o , --output
Write converted text to .

-c , --config
Configuration file

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.

--version
Displays version information and exits.

-h, --help
Displays usage information and exits.


Open Chinese Convert (OpenCC) Dictionary Tool

Usage: opencc_dict.exe -i -o -f -t [--] [--version] [-h]

Options:

-i , --input
(required) Path to input dictionary

-o , --output
(required) Path to output dictionary

-f , --from
(required) Input format

-t , --to
(required) Output format

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.

--version
Displays version information and exits.

-h, --help
Displays usage information and exits.


Open Chinese Convert (OpenCC) Phrase Extractor

Usage: opencc_phrase_extract.exe -o [--] [--version] [-h] ...

Options:

-o , --output
(required) Output file

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.

--version
Displays version information and exits.

-h, --help
Displays usage information and exits.

(accepted multiple times)
(required) Input files

2 comments:

  1. 您好
    想要請問一下
    我有使用AutoHotkey讀取壓縮黨內的ahk檔案了
    執行opencc.exe也有成功跑出您圖片中的視窗
    但是設定好輸入和輸出資料夾和轉換模式按下轉換鍵後
    他好像有跑一下甚麼東西(瞬間)
    然後就沒了
    也沒有轉換東西出來
    想請問這要如何解決呢

    ReplyDelete
  2. 太強了……,一開始搜尋openCC還以為只能在linus系統下使用,沒想到windows也支援,再加上AutoHotKey的介面真的人性化很多

    ReplyDelete