Comparison of Two JavaScript libraries provided by the recent community for converting Chinese characters to PinYin

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.