Skip to main content

API for Cilin

Project description

Cilin

Install

pip install cilin

Usage

from cilin import Cilin

C = Cilin(trad=False)  # trad=True to convert results to traditional Chinese

# Category label
>>> C.get_tag('A')
'人'
>>> C.get_tag('Aa')
'人-泛称'
>>> C.get_tag('Aa01')
'人 人民 众人 角色'

# Terms under a certain category
>>> C.get_members('Ca01B')
{'己巳', '回历', '戊辰', '丙寅', '太阴历', '子丑寅卯', '庚午', '地支', '乙丑', '夏历', '甲午', '旧历', '天干', '巳', '子午卯酉', '阴历', '戊寅', '戊戌', '伊斯兰教历', '丁卯', '农历', '庚子', '庚申', '癸', '辛未', '辛亥'}
>>> C.get_members('Ca01B01=')
{'旧历', '农历', '太阴历', '阴历', '夏历'}

# Divide terms into categories at different levels (1-5)
>>> C.category_split(level=1)
{
    'A': {'荷兰人', '巡视员', '人夫', '农妇', '王子', ...},
    'B': {'赌具', '湖', '敞篷车', '灰黄色', '圆桌', ...},
    ...
    'L': {'费心', '失敬', '劳神', '恭贺', '借问', ...}
}

Acknowledgent

同義詞詞林資料:https://github.com/yaleimeng/Final_word_Similarity/tree/master/cilin/V3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cilin-0.0.3.tar.gz (599.5 kB view hashes)

Uploaded Source

Built Distribution

cilin-0.0.3-py3-none-any.whl (600.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page