<p>Try to search harder. I only typed "generate pinyin ruby markup" in google and found this:</p>

<p><a href="https://github.com/ethantw/az" rel="nofollow noreferrer">az</a></p>

<p>The same search string in DuckDuckGo yielded</p>

<p><a href="https://cjkware.com" rel="nofollow noreferrer">Key</a></p>

CC BY-SA 3.0
2017-11-16T13:36:03.813Z
Interesting.  I'm pretty sure that's one of the search strings I tried.  If it works, this is the answer.  If it doesn't, chances are I can fix it.  Thanks!
伟思礼
CC BY-SA 3.0
2017-11-16T15:17:37.143Z
Well, I tried that search string today and got different results than yesterday.    Maybe there was something different about the string yesterday.  'az' still wasn't there, but perhaps that's because I used DuckDuckGo instead of Google.  What WAS there is extremely interesting: https://cjkware.com/faq/  Sounds like it does everything—except the one thing I was looking for!
伟思礼
CC BY-SA 3.0
2017-11-17T02:04:33.690Z
Key DOES generate ruby—but VERY poorly formatted.  It may have value for other things, but it is a disaster for ruby.  So that makes 'az' the only real answer so far.
伟思礼
CC BY-SA 3.0
2017-11-19T17:04:05.927Z
A retraction to my previous comment.  Key did generate really bad format, but it was on one particular setting, and when I mentioned it to the developer, it was fixed within hours.  I resent large companies making us their unpaid quality control.  I don’t mind so much when the developer is a single person.  So ‘az’ is one answer, but KEY is another.
伟思礼
CC BY-SA 3.0
2017-11-16T04:15:35.760Z
2017-12-10T06:39:05.500Z
2017-12-10T06:39:05.500Z
halfelf
<p>I am very much a beginner, and one of my learning methods is to listen to audio and follow along in text.  But generally, my texts are in Hànzì.</p>

<p>It's easy enough to <a href="http://mandarintools.com/dimsum.html" rel="nofollow noreferrer">convert Hànzì to pīnyīn</a> but I want to start getting familiar with the Hànzì also.  Manually merging Hànzì and pīnyīn into ruby tags looks like a tedious job.  I could write a program to do it, but I suspect someone already has done so.  However, thanks to the programming language called Ruby, finding it in a web search is the proverbial "needle in haystack."</p>

<p>I realize that such a program could get <a href="https://chinese.stackexchange.com/questions/3668/are-there-any-free-fonts-designed-to-help-learn-read-chinese">up to 23% wrong</a>, but manually correcting such errors will be far less tedious than manually generating the entire document.  Using a font with the Ruby built-in is undesirable because then the errors cannot be corrected.</p>

<p>I understand that Firefox and Opera support is lagging, but since the results are for my own use, that doesn't matter.  (And if I ever need to pass on a conversion, I can print to PDF.)_</p>

<p>So, where can I find such a converter?  Or if someone is working on one, perhaps I could help.</p>

<p>I see that Japanese.SE has a <a href="https://japanese.meta.stackexchange.com/questions/806/how-should-i-format-my-questions-on-japanese-language-se">markup for furigana</a> that has a much simpler syntax than HTML5's Ruby.</p>

CC BY-SA 3.0
2017-11-15T17:03:44.980Z
Since I am such a beginner, answers or cited sources in Chinese are better than nothing, but English or Spanish would be much easier.
伟思礼
CC BY-SA 3.0
2017-11-16T06:43:28.937Z
The generator can not be 100% correct, beside the quality of source character list, 多音字, neural tone is a problem, 分词 systems could help, but, I would choose books with pinyin for learners to save troubles.
sfy
CC BY-SA 3.0
2017-11-16T13:32:47.533Z
@Jacob: My third paragraph already says that.  "books with pinyin" do not contain the text my first paragraph says I want to use.  Also, I can't afford to load up my backpack with a bunch of books.
伟思礼
CC BY-SA 3.0
2017-11-16T13:54:04.980Z
Then you can find some audio books, use the tool introduced by @halfelf to generate pinyins. Or you can find a lot of dictionary chrome extensions, you can fork it to generate pinyin instead of translate it, wait, I have made one before, but it only counts the frequencies of pinyin letter as a results
sfy
CC BY-SA 3.0
2017-11-16T14:05:29.657Z
I found my project, it is still works, XD, but it was made 1 years before, the source code is just a totally mess..., 0.js, 1.js, something like that, I'd better stay away from it.
sfy
CC BY-SA 3.0
2017-11-16T14:35:05.947Z
@Jacob: I appreciate the effort; thanks.  But I already have the audio I want to use and the hanzi transcript.
伟思礼
<pinyin>
Generating ruby markup for HTML
# Generating ruby markup for HTML

(Asked by: username_0 on 2017-11-15)

I am very much a beginner, and one of my learning methods is to listen to audio and follow along in text. But generally, my texts are in Hànzì.

It's easy enough to [convert Hànzì to pīnyīn](http://mandarintools.com/dimsum.html) but I want to start getting familiar with the Hànzì also. Manually merging Hànzì and pīnyīn into ruby tags looks like a tedious job. I could write a program to do it, but I suspect someone already has done so. However, thanks to the programming language called Ruby, finding it in a web search is the proverbial "needle in haystack."

I realize that such a program could get [up to 23% wrong](https://chinese.stackexchange.com/questions/3668/are-there-any-free-fonts-designed-to-help-learn-read-chinese), but manually correcting such errors will be far less tedious than manually generating the entire document. Using a font with the Ruby built-in is undesirable because then the errors cannot be corrected.

I understand that Firefox and Opera support is lagging, but since the results are for my own use, that doesn't matter. (And if I ever need to pass on a conversion, I can print to PDF.)\_

So, where can I find such a converter? Or if someone is working on one, perhaps I could help.

I see that Japanese.SE has a [markup for furigana](https://japanese.meta.stackexchange.com/questions/806/how-should-i-format-my-questions-on-japanese-language-se) that has a much simpler syntax than HTML5's Ruby.

**Tags:** pinyin

> **Comments:**
> **username_0**: Since I am such a beginner, answers or cited sources in Chinese are better than nothing, but English or Spanish would be much easier.  
> **username_1**: The generator can not be 100% correct, beside the quality of source character list, 多音字, neural tone is a problem, 分词 systems could help, but, I would choose books with pinyin for learners to save troubles.  
> **username_0**: @Jacob: My third paragraph already says that.  "books with pinyin" do not contain the text my first paragraph says I want to use.  Also, I can't afford to load up my backpack with a bunch of books.  
> **username_1**: Then you can find some audio books, use the tool introduced by @username_2 to generate pinyins. Or you can find a lot of dictionary chrome extensions, you can fork it to generate pinyin instead of translate it, wait, I have made one before, but it only counts the frequencies of pinyin letter as a results  
> **username_1**: I found my project, it is still works, XD, but it was made 1 years before, the source code is just a totally mess..., 0.js, 1.js, something like that, I'd better stay away from it.  
> **username_0**: @Jacob: I appreciate the effort; thanks.  But I already have the audio I want to use and the hanzi transcript.  

---

## 1 answers

### Answer by username_2 on 2017-11-16. Score: 2 | Accepted answer

Try to search harder. I only typed "generate pinyin ruby markup" in google and found this:

[az](https://github.com/ethantw/az)

The same search string in DuckDuckGo yielded

[Key](https://cjkware.com)

> **Comments:**
> **username_0**: Interesting.  I'm pretty sure that's one of the search strings I tried.  If it works, this is the answer.  If it doesn't, chances are I can fix it.  Thanks!  
> **username_0**: Well, I tried that search string today and got different results than yesterday.    Maybe there was something different about the string yesterday.  'az' still wasn't there, but perhaps that's because I used DuckDuckGo instead of Google.  What WAS there is extremely interesting: https://cjkware.com/faq/  Sounds like it does everything—except the one thing I was looking for!  
> **username_0**: Key DOES generate ruby—but VERY poorly formatted.  It may have value for other things, but it is a disaster for ruby.  So that makes 'az' the only real answer so far.  
> **username_0**: A retraction to my previous comment.  Key did generate really bad format, but it was on one particular setting, and when I mentioned it to the developer, it was fixed within hours.  I resent large companies making us their unpaid quality control.  I don’t mind so much when the developer is a single person.  So ‘az’ is one answer, but KEY is another.  

---

