search

Home  >  Q&A  >  body text

编写java函数:将数据库的拼音转换成汉字输出

1.数据库里面存放的存放的是拼音

例如:
传入参数:: CH shandong jinan
输出结果:: 中国 山东 济南

就是这个意思:要传入三个参数

编写能实现以上功能的java函数。

有大仙会吗??

PHP中文网PHP中文网2817 days ago612

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-18 09:14:55

    It is possible to go from Chinese to Pinyin (not necessarily 100% accurate), but from Pinyin to Chinese, it is impossible unless you have a dictionary.
    For example: jinan,计算机怎么知道是济南还是暨南还是晋安?

    Unless you have a dictionary mapping the following relationship:

    [{
        "pinyin":"shandong",
        "chinese":"山东"
    },{
        "pinyin":"jinan",
        "chinese":"济南"
    }}

    Why?
    Because Chinese culture is broad and profound.

    reply
    0
  • Cancelreply