pinyin4j是一提供中文字符转化成多种可定制拼音系统的类库.

Result
pin yin zhuan huan ce shi

Source code analysis

使用Hashmap来存储数据,其中键值为汉字的编码,查询的效率是O(1).

load hashmap
Search
The db is something like this:
3007 (ling2)
4E00 (yi1)
4E01 (ding1,zheng1)
4E02 (kao3)
4E03 (qi1)
4E04 (shang4,shang3)
4E05 (xia4)
4E06 (none0)
4E07 (wan4,mo4)
4E08 (zhang4)
4E09 (san1)
4E0A (shang4,shang3)

Well, that's all.