You can get an example document which contains some sample pinyin here, and which you can copy and use to become familiar with this add-on, as well as read more about how pinyin works. Alternatively create or use a document of your own containing some pinyin.
Pinyin Helper is available from Google Document add-on menu, or directly from the Chrome store.
Once installed, and authorized
activate the add-on by selecting Interpret Tones from the menu.
A sidebar will appear on the right of your document, and if you are at a point in your document where some pinyin with tone numbers is detected you'll see it being converted as below, (otherwise the text is copied over as is). Conversion is carried out in real time, as you type.
You'll see that the sidebar is split into a number of panels, each of which can be shown or hidden by clicking on the Show/Hide text on the blue panel separators..
The text shown in the panels is always a translation of the block of text at which the the document cursor is positioned, or of a selection of text.
The starting panel shown is the 'Tone number to mark' panel, which is the main function of this add-on. The direction of conversion can be chosen by the 'Convert tones' radio button.
In this panel you'll see converted pinyin text - for example this;
Jin1tian1 tian1qi4 shi2fen1 nuan3huo, chu1men2 de shi2hou bu2bi4 chuan1 tai4 duo1 yi1fu.
will be converted into colorized and marked text, as in this example.
Jīntiān tiānqì shífēn nuǎnhuo, chūmén de shíhou búbì chuān tài duō yīfu.
To try , move the document cursor to some pinyin with tone numbers, or simply type some in. You'll notice that the contents of the panel will contain the the converted pinyin. If no pinyin with numbers is found, the current block of text is displayed as is.
You can replace the pinyin in your document with the converted text shown in the panel with the replace button.
The conversion happens in the opposite direction. Your document selection of
Nǐ diǎn de tángcùyú kàn qǐlai hǎochī de hěn, ràng wǒ chī yìkǒu hǎobuhǎo?
will be shown on the sidebar as
Ni3 dian3 de tang2cu4yu2 kan4 qi3lai hao3chi1 de hen3, rang4 wo3 chi1 yi4kou3 hao3buhao3?
To try out, move the document cursor to some pinyin with marks. You'll notice that the contents of the panel will contain the the converted pinyin. If no pinyin with marks is found the current block of text is displayed as is. You can replace the pinyin in your document with that shown in the panel by using the replace button.
This panel shows the result of converting pinyin with tone numbers to marked up pinyin. In this case though, the result is a piece of html that you can copy into some other application.
Many applications that use flash cards or similar media require this kind of code to display properly colored and marked up pinyin. You can use this panel as a feeder to these applications
There are a 3 options available on this panel
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google Docs >