0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PHPでHTMLで日本語の文章に自動でふりがなをふる方法

Posted at

あまり使う機会はないと思いますが、日本語にネイティブむけ、子供向けwebサイトの構築に使えます。

必要なもの

1.mecabなどの日本語形態素解析器ソフト

https://taku910.github.io/mecab/
https://igo.osdn.jp/#feature

rubyというタグを使っていきます。

< ruby > 〜( ~)
これをつかっていきます。

classをインスタンス化するなどしてreadmeなどを参照にしながら、日本語の読みを取得します。
やり方はそれぞれですが、ひらがなだけやカタカナだけは除くなどの分岐をして漢字のみのルビを取得します。

rubyタグの内側に出力すれば完了です。

では。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?