This is a tool for conversion of Chinese characters
(traditional/simplified) in docx files
based on OpenCC.
It does not only do the conversion, but also generates an html file
containing marks on characters which have alternative forms in the
conversion.
- Clone this repo.
- Download
opencc.dllhere and put it inpy/clib/bin/. NOTE: this release is modified based on OpenCC, and the modification can be seen here. It is compiled for Windows 10 64bit version. Please download the source code and compile it for other platforms. - Download config files
and dictionaries,
and put them all in
py/clib/share/opencc/. (For better performance,dictionariescould be compiled intoocd2format and be put in the previous folder. Also they can be found inopenccpackage for python.) - Create your own
config filesordictionariesif you wish.
python docx_char_cnv.py <filename-for-conversion> <config>
# for example
python docx_char_cnv.py ./trad.docx t2s.json
python docx_char_cnv.py ./simp.docx ./my_config_file.jsonThe converted file will have a _modified suffix after
filename-for-conversion in the same folder.
An html file with the same filename will also be generated, in which
all characters having alternative forms in the conversion
will be marked with red color and a "◣" symbol behind.
As for the configuration of customized config files, please refer to
files in sample folder.
- Directly perform conversion on
docxfiles. - Customized dictionaries and rules for conversion (thanks to
OpenCC). - Accurate and quick conversion (thanks to
OpenCC). - All original formats in
docxwill be kept after conversion. - Make it easy for proofreading after conversion.
- OpenCC Apache-2.0 License