Get the Chinese character Radicals radical Python version __python

Source: Internet
Author: User
function Introduction

Pass in a Chinese character and return the dictionary of its radical radicals

Local dictionary and Network Dictionary, local dictionary from the simplified version of the Xinhua dictionary, the Network Dictionary from Baidu Chinese. If the current Chinese characters in the local dictionary, then directly query its radical and return the results if not found in the local dictionary, Baidu Chinese Search

If you want, you can add the results from the network dictionary to your local dictionary. Code

Below two all can download to the source code free of charge
Https://github.com/WenDesi/Chinese_radical
http://download.csdn.net/detail/wds2006sdo/9607195 Results

# Encoding=utf-8 from

radical import radical

if __name__ = = ' __main__ ':
    radical = Radical ()

    # If the word you want to find is in the dictionary, return directly to its radical
    print radical.get_radical (' good ')

    # Local Dictionary is not found, then from Baidu Chinese search
    print radical.get_radical (' 淥 ')

    # You can save the newly added word
    # radical.save () by doing the following

Run the demo above, and the results are as follows:

Related Article

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.