{"id":3209,"date":"2010-03-24T18:44:48","date_gmt":"2010-03-24T10:44:48","guid":{"rendered":"https:\/\/pinyin.info\/news\/?p=3209"},"modified":"2015-12-24T15:17:59","modified_gmt":"2015-12-24T07:17:59","slug":"how-to-create-hanyu-pinyin-subtitles","status":"publish","type":"post","link":"https:\/\/pinyin.info\/news\/2010\/how-to-create-hanyu-pinyin-subtitles\/","title":{"rendered":"How to create Hanyu Pinyin subtitles"},"content":{"rendered":"\n<p>Since posting about the Pinyin subtitles for <a href=\"https:\/\/pinyin.info\/news\/2010\/pinyin-subtitles-for-crouching-tiger-hidden-dragon\/\"><em>Crouching Tiger, Hidden Dragon<\/em><\/a> and <a href=\"https:\/\/pinyin.info\/news\/2010\/pinyin-subtitles-for-the-story-of-stuff\/\"><em>The Story of Stuff<\/em><\/a> I have received several messages inquiring about how someone might make Pinyin subtitles themselves. So I might as well put the answer online. <\/p>\n<p>Although at the present stage of software implementation subtitle conversion isn&#8217;t as simple as pushing a button, the process is not particularly difficult, assuming you have a good source text to work from. But this does require some time and the right tools. <\/p>\n<p><strong style=\"color: green;\">The Right Tools<\/strong><\/p>\n<p>The most important tool is, of course, the one that performs the conversion to Hanyu Pinyin. And it&#8217;s crucial to keep in mind that not all Pinyin converters are created equal; in fact, the vast majority of so-called Pinyin converters are best avoided entirely. The world does not need any more texts in the hobbled, poorly written mess that many people erroneously think of as Hanyu Pinyin; but it very much needs texts in <a href=\"https:\/\/pinyin.info\/news\/category\/writing-systems\/pinyin-rules\/\"><em>real<\/em> Hanyu Pinyin<\/a>. So don&#8217;t waste your time with a program that doesn&#8217;t do a good job of word parsing, etc. <\/p>\n<p>At present the clear front-runner for converting Chinese characters to Hanyu Pinyin texts (<em>real<\/em> Hanyu Pinyin texts) with a minimum need for user assistance is <a href=\"http:\/\/www.cjkware.com\/\">Key Chinese<\/a> (Windows and Mac). The  <a href=\"http:\/\/www.cjkware.com\/download.html\">demo version<\/a> is fully functional for 30 days. Key&#8217;s considerably less expensive &#8220;Hanzi To Pinyin With Tones Conversion Utility&#8221; for MS Word texts (also with a 30-day demo) would probably also work well, though I haven&#8217;t tried it myself. <\/p>\n<p><a href=\"http:\/\/www.wenlin.com\/\">Wenlin<\/a> (Windows and Mac) is another excellent program that can produce properly spelled and word-parsed Hanyu Pinyin. But it requires users to run some disambiguation themselves, which can take a <em>lot<\/em> of time when you&#8217;re talking about something with as much text as a screenplay. Nonetheless, Wenlin&#8217;s incorporation of John DeFrancis&#8217;s <a href=\"https:\/\/pinyin.info\/readings\/abc2.html\"><em>ABC Chinese-English Comprehensive Dictionary<\/em><\/a> makes it a helpful reference when performing post-conversion checks. Also, especially if one does not have Key, Wenlin &#8212; even the function-limited but non-expiring demo version &#8212; is useful for handling some adjustments (such as removing tone marks or providing a workaround when dealing with programs that don&#8217;t handle Chinese characters well). <\/p>\n<p>You&#8217;ll also need a Unicode-friendly text editor with good support of regular expressions (to allow wildcard searches). I like <a href=\"http:\/\/www.emeditor.com\/\">Em Editor<\/a>, which is Windows based. But lots of other programs would work. One could even use MS Word if so inclined. <\/p>\n<p>Finally, having subtitles in an additional language (usually but not necessarily English) is often desirable, not just for others who would use these subtitles but for yourself as you create the Pinyin subtitles. But often the subtitles one may find in Mandarin are not in synch with those in another language. Software can fix this problem. But I don&#8217;t have enough experience with this to recommend certain programs over others. <\/p>\n<p>To sum up, the tools I recommend for creating Hanyu Pinyin subtitles are<\/p>\n<ol>\n<li>Key Chinese<\/li>\n<li>Wenlin<\/li>\n<li>EmEditor (or another Unicode-friendly text editor)<\/li>\n<li>a subtitle synchronizer<\/li>\n<\/ol>\n<p>Actually, just the first one, Key, is sufficient to produce Pinyin subtitles. But in my experience using a combination of all four programs is preferable. <\/p>\n<p>Now it&#8217;s time to get down to business.<\/p>\n<p><strong style=\"color: green;\">The Main Steps<\/strong><\/p>\n<ol>\n<li>acquire source-version subtitles<\/li>\n<li>synchronize subtitle files<\/li>\n<li>identify names of the movie&#8217;s characters (<em>dramatis personae<\/em>)<\/li>\n<li>perform initial conversion of subtitles in Chinese characters to Pinyin<\/li>\n<li>double check the results and perform necessary cleanup<\/li>\n<li>create additional version without tone marks<\/li>\n<li>share your work<\/li>\n<\/ol>\n<p><strong style=\"color: green;\">1. Acquire subtitles for conversion and reference<\/strong><\/p>\n<p>At present the most useful site for finding Mandarin subtitles written in Chinese characters is probably <a href=\"http:\/\/shooter.cn\/\">Shooter<\/a>. You may need to try searching for your desired title in both simplified and traditional characters. Also, be aware that movies &#8212; especially movies not filmed in Mandarin &#8212; often have different names in China, Taiwan, Hong Kong, etc.<\/p>\n<p>You may find it useful to look for subtitles in other languages, too. Shooter can be useful for that, though you may have better luck finding English subtitles at <a href=\"http:\/\/opensubtitles.org\/\">Opensubtitles.org<\/a> or similar English-language sites.<\/p>\n<p>One can often find different subtitle files for the same movie, so you may wish to examine more than one for quality. Another thing that&#8217;s worth keeping in mind: Converting from traditional Chinese characters to simplified Chinese characters is less problematic than vice versa. <\/p>\n<p><strong style=\"color: green;\">2. Synchronize subtitle files<\/strong><\/p>\n<p>Once you have the files, you should synchronize them with each other according to the directions for the particular program you are using. <\/p>\n<p>If the program you&#8217;re using for this chokes on Chinese characters, though, you&#8217;ll need to take a couple extra steps. First, convert the Chinese characters to Unicode numerical character references using either <a href=\"https:\/\/pinyin.info\/tools\/converter\/chars2uninumbers.html\">Pinyin Info&#8217;s NCR conversion tool<\/a> or Wenlin (full or demo version). The reason for this is that even synchronizers that screw up &#8220;&#26446;&#24917;&#30333;&#8221; should be able to handle the NCR equivalent: &#8220;&amp;#26446;&amp;#24917;&amp;#30333;&#8221;. <\/p>\n<p>In Wenlin,<br \/>\n<strong>Edit<\/strong> &#8211;> <strong>Make transformed copy<\/strong> &#8211;> <strong>Encode &#038;#; [decimal]<\/strong> <\/p>\n<p>Take the NCR text and synchronize the files. After you get this taken care of, reconvert to Chinese characters. <\/p>\n<p>In Wenlin,<br \/>\n<strong>Edit<\/strong> &#8211;> <strong>Make transformed copy<\/strong> &#8211;> <strong>Decode &#038;#;<\/strong><\/p>\n<p><strong style=\"color: green;\">3. identify names of the movie&#8217;s characters<\/strong><\/p>\n<p>You must teach your software know which strings of Hanzi represent names. For example, it&#8217;s crucial for clarity that the character name &#8220;&#26446;&#24917;&#30333;&#8221; is written &#8220;<span class=\"py\">L&#464; M&#249;b&#225;i<\/span>&#8221; rather than as &#8220;<span class=\"py\">l&#464; m&#249; b&#225;i<\/span>&#8220;. This part takes some time up front. But <em>do not skip this step<\/em>, because it is not only crucial but will save a lot of trouble in the long run. <\/p>\n<p>Before doing this, however, people may want to refamiliarize themselves with <a href=\"https:\/\/pinyin.info\/readings\/yin_binyong\/o2_proper_nouns.pdf\">Hanyu Pinyin&#8217;s rules for proper nouns<\/a> (PDF). Note especially what is supposed to be capitalized and what isn&#8217;t. <\/p>\n<p>The <a href=\"http:\/\/zh.wikipedia.org\/\">Mandarin version of Wikipedia<\/a> is one resource that can be helpful in identifying the names of at least the main characters in the movie. But you&#8217;ll want to look for more names and forms than will be listed there. Keep in mind that characters aren&#8217;t always addressed by their full names. You need to look for other forms as well (e.g., in <em>Crouching Tiger, Hidden Dragon<\/em> Li Mubai is sometimes referred to as &#8220;Li Mubai&#8221; but other times as &#8220;Li ye&#8221; or simply as &#8220;Mubai&#8221;) and enter them. <\/p>\n<p>English subtitles can be very useful for locating most proper nouns in the text. (Hooray for word parsing and capitalization of proper nouns!) The following search of an English subtitle file should help pinpoint the location of proper nouns. <\/p>\n<p>find (with &#8220;Match Case&#8221; and &#8220;Use Regular Expressions&#8221; checked):<br \/>\n<code>[^\\.]\\s[A-Z][a-z]<\/code><\/p>\n<p>in MS Word, find (with &#8220;Use wildcards&#8221; checked):<br \/>\n<code>[!\\.] [A-Z][a-z]<\/code><\/p>\n<p>Since you&#8217;ve already synchronized your subtitles, you&#8217;ll easily be able to find the corresponding point in the Mandarin subtitles by looking at the time the line appears. <\/p>\n<p>As you gather the names, or after you compile the full list, add your findings to the Pinyin converter&#8217;s user dictionary. In Key, perform <strong>Language<\/strong> &#8211;> <strong>Add Record<\/strong>, then fill in the Hanzi and Pinyin fields. <\/p>\n<p><strong style=\"color: green;\">4. Perform initial conversion to Pinyin<\/strong><\/p>\n<p>OK, I know you&#8217;re eager to run the conversion and see all of those Hanzi turn into lovely Hanyu Pinyin. But there&#8217;s one quick step you need to do first. If you&#8217;re using Key Chinese, the program won&#8217;t make use of all of those character names you just painstakingly added to the user dictionary unless you first run &#8220;linguistic reconstruction&#8221; on the subtitles you wish to convert:<br \/>\n<strong>Language<\/strong> &#8211;> <strong>Linguistic Reconstruction<\/strong><\/p>\n<p>Now you&#8217;re ready for the big step:<br \/>\n<strong>Language<\/strong> &#8211;> <strong>Convert to Pinyin<\/strong><\/p>\n<p><strong style=\"color: green;\">5. Double check the results and perform necessary cleanup<\/strong><\/p>\n<p>Unfortunately, most Pinyin converters &#8212; even the best &#8212; tend to be lazy about inserting spaces in some of the places they belong, such as around numeric and alphabetic strings. For example, &#8220;&#33258;3&#26376;22&#26085;&#65288;&#26143;&#26399;&#19968;&#65289;&#36215;&#33267;5&#26376;31&#26085;&#65288;&#26143;&#26399;&#19968;&#65289;&#8221; will generally convert to something that looks like this:<br \/>\n&#8220;z&#236;3yu&#232;22r&#236; (X&#299;ngq&#299;y&#299;) q&#464; zh&#236;5yu&#232;31r&#236; (X&#299;ngq&#299;y&#299;)&#8221;.<br \/>\nBut it <em>should<\/em> look like this:<br \/>\n&#8220;z&#236; 3 yu&#232; 22 r&#236; (X&#299;ngq&#299;y&#299;) q&#464; zh&#236; 5 yu&#232; 31 r&#236; (X&#299;ngq&#299;y&#299;)&#8221;.  <\/p>\n<p>To fix this in your Pinyin text, run the following regular expression in EmEditor. Make sure &#8220;Match Case&#8221; is <em>not<\/em> checked.<br \/>\nfind:<br \/>\n<span class=\"py\">([a-z&#257;&#225;&#462;&#224;&#275;&#233;&#283;&#232;&#299;&#237;&#464;&#236;&#333;&#243;&#466;&#242;&#363;&#250;&#468;&#249;&#470;&#472;&#474;&#476;])([0-9]+)([a-z&#257;&#225;&#462;&#224;&#275;&#233;&#283;&#232;&#299;&#237;&#464;&#236;&#333;&#243;&#466;&#242;&#363;&#250;&#468;&#249;&#470;&#472;&#474;&#476;])<\/span><\/p>\n<p>replace:<br \/>\n<code>\\1 \\2 \\3<\/code><\/p>\n<p>If you do this in Word, you&#8217;ll need to use the following instead in your wildcard search.<br \/>\nfind:<br \/>\n<span class=\"py\">([A-Za-z&#256;&#193;&#461;&#192;&#274;&#201;&#282;&#200;&#298;&#205;&#463;&#204;&#332;&#211;&#465;&#210;&#362;&#218;&#467;&#217;&#469;&#471;&#473;&#475;&#257;&#225;&#462;&#224;&#275;&#233;&#283;&#232;&#299;&#237;&#464;&#236;&#333;&#243;&#466;&#242;&#363;&#250;&#468;&#249;&#470;&#472;&#474;&#476;])([0-9]{1,})([A-Za-z&#256;&#193;&#461;&#192;&#274;&#201;&#282;&#200;&#298;&#205;&#463;&#204;&#332;&#211;&#465;&#210;&#362;&#218;&#467;&#217;&#469;&#471;&#473;&#475;&#257;&#225;&#462;&#224;&#275;&#233;&#283;&#232;&#299;&#237;&#464;&#236;&#333;&#243;&#466;&#242;&#363;&#250;&#468;&#249;&#470;&#472;&#474;&#476;])<\/span><\/p>\n<p>replace:<br \/>\n<code>\\1 \\2 \\3<\/code><\/p>\n<p>The rest of cleanup work usually involves you simply reading through the text, looking for errors, perhaps while listening to the movie. <\/p>\n<p><strong style=\"color: green;\">6. Create additional version without tone marks<\/strong><\/p>\n<p>If you have Key, this is very easy: Highlight the entire text, then<br \/>\n<strong>Format<\/strong> &#8211;> <strong>Strip Tone Marks<\/strong>. <\/p>\n<p>And you&#8217;re done, though because Key keeps u-umlaut as such, if your television or other device doesn&#8217;t show the letter &#252; correctly you may wish to convert &#8220;&#252;&#8221; to &#8220;v&#8221;. <\/p>\n<p>If you <em>don&#8217;t<\/em> have Key or access to another program that can do the same thing as easily, then use a combination of Wenlin (again, even the demo will do what you need) and a text editor. First, paste your Pinyin text into Wenlin. Then select all of the text and perform<br \/>\n<strong>Edit<\/strong> &#8211;> <strong>Make transformed copy&#8230;<\/strong> &#8211;> <strong>Replace tone marks with 1-4<\/strong><\/p>\n<p>Copy and paste the results into a new document in your text editor. Then run the following search-and-replace. Make certain the &#8220;Use Regular Expressions&#8221; or &#8220;Use Wildcards&#8221; box is checked.<\/p>\n<p>find:<br \/>\n<code>([A-Za-z])([1-4])<\/code><\/p>\n<p>replace with:<br \/>\n<code>\\1<\/code><br \/>\nThen click &#8220;Replace All&#8221;.<\/p>\n<p>What this looks like in EmEditor:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pinyin.info\/news\/news_photos\/2010\/03\/remove_tone_numbers.gif\" alt=\"image showing the search-and-replace dialog box for the above\" title=\"remove_tone_numbers\" width=\"338\" height=\"289\" \/><\/p>\n<p>What this looks like in MS Word:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pinyin.info\/news\/news_photos\/2010\/03\/remove_tone_numbers_Word.gif\" alt=\"\" title=\"remove_tone_numbers_Word\" width=\"510\" height=\"431\" \/><\/p>\n<p><strong style=\"color: green;\">7. Share your work<\/strong><\/p>\n<p>It&#8217;s much better if people can concentrate on producing new material rather than having to redo things others have already taken care of. So if you make a good Hanyu Pinyin version of something, please let me know. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since posting about the Pinyin subtitles for Crouching Tiger, Hidden Dragon and The Story of Stuff I have received several messages inquiring about how someone might make Pinyin subtitles themselves. So I might as well put the answer online. Although &hellip; <a href=\"https:\/\/pinyin.info\/news\/2010\/how-to-create-hanyu-pinyin-subtitles\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15,113,41,106,28,32,20,38,73,105,594],"tags":[],"class_list":["post-3209","post","type-post","status-publish","format-standard","hentry","category-chinese","category-chinese-characters","category-computers","category-english","category-hanyu","category-languages","category-mandarin","category-pinyin","category-software","category-subtitles","category-tone-marks","category-unicode-writing-systems"],"_links":{"self":[{"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/posts\/3209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/comments?post=3209"}],"version-history":[{"count":56,"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/posts\/3209\/revisions"}],"predecessor-version":[{"id":7165,"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/posts\/3209\/revisions\/7165"}],"wp:attachment":[{"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/media?parent=3209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/categories?post=3209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pinyin.info\/news\/wp-json\/wp\/v2\/tags?post=3209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}