A Microsoft Word add-in for adding tone graphs, pinyin or zhuyin to Hanzi(汉字).
The tones are automatically placed above the chinese characters, by the computer using a dictionary (CC-CEDICT) for the longest word it can find. If it is unsure of the tones, it will place multiple tones above the character (here 好, as 大家好 is not in the dictionary as one word).
To annotate tones for LaTeX, see hanzi2tghz.
This project is hosted on GitHub.
Before use, please remember to make a backup of your document, just in case.
To add tones or pinyin to text select some, or all the text (Ctrl+a
), and press either the Add Tones
, Add Pinyin
or Add Zhuyin
Button. When the dictionary finds multiple pronunciations for tones it puts multiple tones. For Pinyin or Zhuyin, it duplicates the words with the various pronuciations. To reduce duplicates use the Dictionary Correction utilities.
When tones or pinyin are added, all the font information about the text before is lost, so the size, colour, font, etc. are reset to the default.
When removing tones or pinyin, it is preferable to use the undo
button, to undo the previous action of adding them. For tones, the Remove Tones/Pinyin
button can be used, but it can be problematic for pinyin, as it does not remove the duplicated characters caused by converting to pinyin.
To edit tones or pinyin, click on or select some text, then press the Edit Tones or Pinyin
button and the incorrectly named Edit Text or Pinyin
window should appear.
Here 大家好 has tones, and 欢迎来到我的网站 has pinyin. For tones, put the number of the tone or tones, in the text box on the right. For pinyin put the pinyin followed by the tone number.
When the text is resized the tone/pinyin do not scale with the text size. The solution is to use one of the resize
buttons.
To resize pinyin or zhuyin fuhao, use the Pinyin Resize:
button. The number next to it (0.5
is the default) is the relative size of the text compared to the characters, i.e. 0.5
is half the size, 1.0
is the same size.
For Tones there are two issues the size of the tones and the height of the tones above the characters. For the size of the tones use the Tone Resize:
button and change the relative size if you wish. For the height of the tones, change the number next to the Tone Height:
button (12
is the default, make it larger for larger text), then click the Tone Height:
button.
To enable dictionary correction press the Enable
button in the Dictionary Corrections
Section of the toolbar/Ribbon. By default there are no corrections, you can see the avaliable corrections, by pressing the Edit Dictionary
in the Dictionary Corrections
section. To import a tone corrections dictionary, or make yourown, see below.
To open the Dictionary Corrections window press the Edit Dictionary
button.
Press the Done
button to close the window saving changes.
To add a correction, type the chinese characters in the box containing 汉字
and the pinyin, separated by character by spaces, postfixed with the tone graph number, in the han4 zi4
box. Then press the Add
button and it should be copied into the list. See the above window for examples.
For multiple pronuciations add the same chinese characters twice, with different pronunciations.
To delete words, select the large grey box to the left of the row you wish to delete, and press the delete key. There is no button in the window to do this.
The words in the dictionary cannot be edited, to preven errors in the program. To edit one delete it, and add the corrected version.
Words can be enabled or disabled individually, buy having the tickbox checked or unchecked, respectively.
Edits to the dictionary can be imported or exported, to enable sharing, by selecting an option in the File
Menu.
Currently there is no undo mechanism for this. The tone corrections file is a hidden file called tghzToneCorrections.txt
in your personal user or home folder. The file can be backed up by exporting it (see below) or making a duplicate. Deleting this file should cause a new empty file.
To import a tone corrections file, press the Edit Dictionary
button, and then File -> Import Dictionary Corrections File
from the menu bar in the Dictionary Corrections
window. A file dialog box will appear allowing you to choose the file to import. Please be careful to select the correct file.
Here is my Tone Corrections File. To download it, right-click the hyperlink and choose Save Link As...
, or similar.
To export a tone corrections file, press the Edit Dictionary
button, and then File -> Export Dictionary Corrections File
from the menu bar in the Dictionary Corrections
window. A file dialog box will appear allowing you to choose where to export the file to.
Tones/pinyin and/or characters can be coloured using the colour button. Tick the box(es) before adding tones or pinyin for the output to also be coloured.
To convert from traditional or simplified to simplified or traditional, select the text and press the To Simplified
or To Traditional
buttons, respectively.
If you have any problems, please feel free to email me.
While running the setup file there may be a certificate error:
, because it is installing from an untrusted location.
To fix this, https://raw.githubusercontent.com
needs to be added to the list of trusted sites:
Open Internet Explorer, and click the Gear Icon
(top right corner) and then choose Internet Options
. In the Internet Options
window select Security
, then Trusted Sites
, then click the button that says Sites
. In the Trusted sites
window copy and paste:
https://raw.githubusercontent.com
and Add
it. It should now be possible to install the program. But beware, this will make your computer trust any content from github, not just this add-in. To be safe it should be removed after installation, but the program will not automatically update.
While running the setup file, there may be an error message with the Visual Studio Tools for Office Solution Installer
.
To fix this, please run the setup program as an administrator.
(This problem was seen on Windows 8.1)
If there are any other problems with using or installing the software, please email me or submit an issue.