Giter VIP home page Giter VIP logo

docx_character_converter's Introduction

Introduction

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.

Setup

  1. Clone this repo.
  2. Download opencc.dll here and put it in py/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.
  3. Download config files and dictionaries, and put them all in py/clib/share/opencc/. (For better performance, dictionaries could be compiled into ocd2 format and be put in the previous folder. Also they can be found in opencc package for python.)
  4. Create your own config files or dictionaries if you wish.

Usage

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.json

The 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.

Features

  • Directly perform conversion on docx files.
  • Customized dictionaries and rules for conversion (thanks to OpenCC).
  • Accurate and quick conversion (thanks to OpenCC).
  • All original formats in docx will be kept after conversion.
  • Make it easy for proofreading after conversion.

Acknowledgements

docx_character_converter's People

Contributors

nemo-nullius avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.