DrawGrayScale
Setting up the repository
requirements:
- python 2.7
- matplotlib
- pillow & ipyton (not necessary)
Data format
- Chinese
- English
- Alignment
DrawGrayScale Usage
linux usage (x for input y for output utf-8 file)
add auto-fill owing to alignment (add eos symbol)
python drawgrayscale_linux.py ./data/x.file ./data/y.file ./data/ailgn.file ./data/fileout
windows usage
python drawgrayscale.py ./data/file.ch ./data/file.en ./data/file.align ./data/fileout
Examples
With the data provided, you can get an image as follows:
Tips
Windows_Tips
if you want to draw a picture with Chinese characters, as in drawgrayscale.py(line 70), links are listed:
solution1, solution2, solution3
or just move font/simhei.ttf
to $PYTHON_PATH\Lib\site-packages\matplotlib\mpl-data\fonts\ttf
(windows only)
Linux_tips
if you want to draw a picture with Chinese characters on top of linux, as in drawgrayscale_line.py(line 15), you may change the path to your own Chinese character path. links are listed as follows: solution_linux