JSPinyin is better than the library of pinyin. js, and it is more accurate to translate Chinese into pinyin.
JSPinyin provides two methods:
1) One is to translate Chinese characters into pinyin, where the first letter of each word is capitalized;
1
Pinyin. getFullChars (this. value );
2) One is to extract the first letter of each character in upper case.
1
Pinyin. getCamelChars (this. value );
You can also set whether to determine the polyphonic words. However, the functions are relatively simple. If you need other relatively complex functions, you can only add some methods to them. It depends on the JavaScript library mootools and can be modified to the prototype library or another one.
The test is as follows:
Pinyin. js provides many functions. For example, it provides multiple dictionaries and can be converted to PinYin with tones, but the conversion accuracy is relatively low, for example, the link provided on the official website does not contain any Chinese translation. The dictionary may be faulty.
Author: Xiaotian