def get_comparative_ci1_dash(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-2]}ее', '.ПС1'), WordForm(f'{pmi[:-2]}ей', '.ПС2'), ] return word_forms
def get_comparative_cii5ch(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-3]}че', '.ПС'), WordForm(f'по{pmi[:-3]}че', '.ПС*'), ] return word_forms
def get_short_k1_m(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-2]}а', '.ПКж'), WordForm(f'{pmi[:-2]}о', '.ПКс'), WordForm(f'{pmi[:-2]}ы', '.ПКмн'), ] return word_forms
def get_short_k1_sharp_prim(src_dict) -> list: pkm = src_dict['name'] word_forms = [ WordForm(pkm, '.ПКм'), WordForm(f'{pkm[:-2]}{pkm[-1]}а', '.ПКж'), WordForm(f'{pkm[:-2]}{pkm[-1]}о', '.ПКс'), WordForm(f'{pkm[:-2]}{pkm[-1]}ы', '.ПКмн'), ] return word_forms
def get_short_k2_sharp_e(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-4]}е{pmi[-3]}', '.ПКм'), WordForm(f'{pmi[:-2]}а', '.ПКж'), WordForm(f'{pmi[:-2]}о', '.ПКс'), WordForm(f'{pmi[:-2]}и', '.ПКмн'), ] return word_forms
def get_comparative_cii6ch_9sh(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-4]}че', '.ПС1'), WordForm(f'{pmi[:-4]}ше', '.ПС2'), WordForm(f'по{pmi[:-4]}че', '.ПС1*'), WordForm(f'по{pmi[:-4]}ше', '.ПС2*'), ] return word_forms
def get_short_k7(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-3]}', '.ПКм'), WordForm(f'{pmi[:-2]}я', '.ПКж'), WordForm(f'{pmi[:-2]}е', '.ПКс'), WordForm(f'{pmi[:-2]}и', '.ПКмн'), ] return word_forms
def get_short_k6_and_1e(src_dict) -> list: pmi = src_dict['name'] word_forms = [ WordForm(f'{pmi[:-3]}', '.ПКм1'), WordForm(f'{pmi[:-3]}е{pmi[-3]}', '.ПКм2'), WordForm(f'{pmi[:-2]}а', '.ПКж'), WordForm(f'{pmi[:-2]}о', '.ПКс'), WordForm(f'{pmi[:-2]}ы', '.ПКмн'), ] return word_forms
def imperative_mood_pv2_2prim_dash(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{name[:-3]}и', '.ГПве'), ] else: word_forms = [ WordForm(f'{name[:-5]}ись', '.ГПве'), ] return word_forms
def past_tense_p1_dash(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{name[:-2]}ло', '.ГПс'), ] else: word_forms = [ WordForm(f'{name[:-4]}лось', '.ГПс'), ] return word_forms
def present_participle_dn3(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{name[:-2]}я', '.ДН'), ] else: word_forms = [ WordForm(f'{name[:-4]}ясь', '.ДН'), ] return word_forms
def past_participle_dp9(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{name[:-2]}в', '.ДП'), WordForm(f'{name[:-2]}вши', '.ДП*'), ] else: word_forms = [ WordForm(f'{name[:-2]}вшись', '.ДП'), ] return word_forms
def query_text(word): print("句子:%s" % word) handler = WordForm(etc.STROKE_FILE_PATH, etc.RADICAL_FILE_PATH, etc.CHAR_DICT) strokes = handler.get_strokes(word) pinyins = handler.get_pinyin(word) radicals = handler.get_radical(word) print('笔画:', strokes) print('拼音:', pinyins) print('偏旁部首:', radicals) print('\n')
def imperative_mood_pv1_prim_dash(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): gpve = f'{name[:-2]}й' word_forms = [ WordForm(gpve, '.ГПве'), ] else: gpve = f'{name[:-4]}йся' word_forms = [ WordForm(gpve, '.ГПве'), ] return word_forms
def imperative_mood_pv2_2prim(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(name, '.ГПве'), WordForm(f'{name}те', '.ГПвмн'), ] else: word_forms = [ WordForm(name, '.ГПве'), WordForm(f'{name[:-2]}тесь', '.ГПвмн'), ] return word_forms
def joint_action_c(src_dict) -> list: name = src_dict['name'] gnb1mn = list( filter(lambda x: x.idf == '.ГНБ1мн', get_present_future_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{gnb1mn}те', '.ГСДмн'), ] else: word_forms = [ WordForm(f'{gnb1mn[:-2]}тесь', '.ГСДмн'), ] return word_forms
def past_participle_dp8(src_dict) -> list: name = src_dict['name'] gnb2e = list( filter(lambda x: x.idf == '.ГНБ2е', get_present_future_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{gnb2e[:-3]}я', '.ДП!'), ] else: word_forms = [ WordForm(f'{gnb2e[:-5]}ясь', '.ДП!'), ] return word_forms
def imperative_mood_pv2_2_excl(src_dict) -> list: name = src_dict['name'] gnb3mn1 = list( filter(lambda x: x.idf == '.ГНБ3мн1', get_present_future_forms(src_dict)))[0].name gnb3mn2 = list( filter(lambda x: x.idf == '.ГНБ3мн2', get_present_future_forms(src_dict)))[0].name gnb2mn2 = list( filter(lambda x: x.idf == '.ГНБ2мн2', get_present_future_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): gpve1 = f'{gnb3mn1[:-2]}и' gpve2 = f'{gnb3mn2[:-2]}и' word_forms = [ WordForm(gpve1, '.ГПве1'), WordForm(gpve2, '.ГПве2'), WordForm(f'{gpve1}те', '.ГПвмн1'), WordForm(gnb2mn2, '.ГПвмн2'), ] else: gpve1 = f'{gnb3mn1[:-4]}ись' gpve2 = f'{gnb3mn2[:-4]}ись' word_forms = [ WordForm(gpve1, '.ГПве1'), WordForm(gpve2, '.ГПве2'), WordForm(f'{gpve1[:-2]}тесь', '.ГПвмн1'), WordForm(gnb2mn2, '.ГПвмн2'), ] return word_forms
def past_participle_dp5d(src_dict) -> list: name = src_dict['name'] gpm = list( filter(lambda x: x.idf == '.ГПм', get_past_tense_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{gpm[:-1]}дши', '.ДП'), ] else: word_forms = [ WordForm(f'{gpm[:-3]}дшись', '.ДП'), ] return word_forms
def imperative_mood_pv1_dash(src_dict) -> list: name = src_dict['name'] gnb3e = list( filter(lambda x: x.idf == '.ГНБ3е', get_present_future_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{gnb3e[:-2]}й', '.ГПве'), ] else: word_forms = [ WordForm(f'{gnb3e[:-4]}йся', '.ГПве'), ] return word_forms
def imperative_mood_pv1_prim_e(src_dict) -> list: name = src_dict['name'] if not name.endswith(('ся', 'сь')): gpve = f'{name[:-3]}ей' word_forms = [ WordForm(gpve, '.ГПве'), WordForm(f'{gpve}те', '.ГПвмн'), ] else: gpve = f'{name[:-5]}ейся' word_forms = [ WordForm(gpve, '.ГПве'), WordForm(f'{gpve[:-2]}тесь', '.ГПвмн'), ] return word_forms
def get_singular_i1_and_1_sharp(src_dict) -> list: sei = src_dict['name'] word_forms = [ WordForm(sei, '.СеИ'), WordForm(f'{sei}а', '.СеР1'), WordForm(f'{sei[:-2]}{sei[-1]}а', '.СеР2'), WordForm(f'{sei}у', '.СеД1'), WordForm(f'{sei[:-2]}{sei[-1]}у', '.СеД2'), WordForm(sei, '.СеВ'), WordForm(f'{sei}ом', '.СеТ1'), WordForm(f'{sei[:-2]}{sei[-1]}ом', '.СеТ2'), WordForm(f'{sei}е', '.СеП1'), WordForm(f'{sei[:-2]}{sei[-1]}е', '.СеП2'), ] return word_forms
def get_singular_i3_sharp_and_3_sharp_prim(src_dict) -> list: sei = src_dict['name'] word_forms = [ WordForm(sei, '.СеИ'), WordForm(f'{sei[:-3]}{sei[-2]}я', '.СеР1'), WordForm(f'{sei[:3]}у{sei[3:-3]}{sei[-2]}я', '.СеР2'), WordForm(f'{sei[:-3]}{sei[-2]}ю', '.СеД1'), WordForm(f'{sei[:3]}у{sei[3:-3]}{sei[-2]}ю', '.СеД2'), WordForm(sei, '.СеВ'), WordForm(f'{sei[:-3]}{sei[-2]}ем', '.СеТ1'), WordForm(f'{sei[:3]}у{sei[3:-3]}{sei[-2]}ем', '.СеТ2'), WordForm(f'{sei[:-3]}{sei[-2]}е', '.СеП1'), WordForm(f'{sei[:3]}у{sei[3:-3]}{sei[-2]}е', '.СеП2'), ] return word_forms
def present_participle_dn4(src_dict) -> list: name = src_dict['name'] gnb1mn = list(filter( lambda x: x.idf == '.ГНБ1мн', get_present_future_forms(src_dict) ))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{gnb1mn[:-2]}я', '.ДН'), ] else: word_forms = [ WordForm(f'{gnb1mn[:-4]}ясь', '.ДН'), ] return word_forms
def get_singular_i7_and_ii4_prim(src_dict) -> list: sei = src_dict['name'] word_forms = [ WordForm(sei, '.СеИ'), WordForm(f'{sei[:-1]}а', '.СеР1'), WordForm(f'{sei[:-1]}и', '.СеР2'), WordForm(f'{sei[:-1]}у', '.СеД1'), WordForm(f'{sei[:-1]}е', '.СеД2'), WordForm(f'{sei[:-1]}а', '.СеВ1'), WordForm(f'{sei[:-1]}у', '.СеВ2'), WordForm(f'{sei[:-1]}ем', '.СеТ1'), WordForm(f'{sei[:-1]}ей', '.СеТ2'), WordForm(f'{sei[:-1]}е', '.СеП'), ] return word_forms
def get_singular_iii1_and_1_prim(src_dict) -> list: sei = src_dict['name'] word_forms = [ WordForm(sei, '.СеИ'), WordForm(f'{sei[:-1]}и', '.СеР1'), WordForm(f'{sei[:3]}у{sei[3:-1]}и', '.СеР2'), WordForm(f'{sei[:-1]}и', '.СеД1'), WordForm(f'{sei[:3]}у{sei[3:-1]}и', '.СеД2'), WordForm(sei, '.СеВ'), WordForm(f'{sei}ю', '.СеТ1'), WordForm(f'{sei[:3]}у{sei[3:]}ю', '.СеТ2'), WordForm(f'{sei[:-1]}и', '.СеП1'), WordForm(f'{sei[:3]}у{sei[3:-1]}и', '.СеП1'), ] return word_forms
def past_participle_dp9_dash_and_4(src_dict) -> list: name = src_dict['name'] gpm = list( filter(lambda x: x.idf == '.ГПм', get_past_tense_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{name[:-2]}в', '.ДП1'), WordForm(f'{gpm}ши', '.ДП2'), ] else: word_forms = [ WordForm(f'{name[:-4]}вшись', '.ДП1'), WordForm(f'{gpm[:-2]}шись', '.ДП2'), ] return word_forms
def imperative_mood_pv3_2prim(src_dict) -> list: name = src_dict['name'] gnb2e = list( filter(lambda x: x.idf == '.ГНБ2е', get_present_future_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(gnb2e, '.ГПве'), WordForm(f'{gnb2e}те', '.ГПвмн'), ] else: word_forms = [ WordForm(gnb2e, '.ГПве'), WordForm(f'{gnb2e[:-2]}тесь', '.ГПвмн'), ] return word_forms
def imperative_mood_pv2_excl_dash(src_dict) -> list: name = src_dict['name'] gnb2mn = list( filter(lambda x: x.idf == '.ГНБ2мн', get_present_future_forms(src_dict)))[0].name if not name.endswith(('ся', 'сь')): word_forms = [ WordForm(f'{name[:-3]}и', '.ГПве'), WordForm(gnb2mn, '.ГПвмн'), ] else: word_forms = [ WordForm(f'{name[:-5]}ись', '.ГПве'), WordForm(gnb2mn, '.ГПвмн'), ] return word_forms
def get_singular_i2_4(src_dict) -> list: sei = src_dict['name'] word_forms = [ WordForm(sei, '.СеИ'), WordForm(f'{sei[:-1]}и', '.СеР'), WordForm(f'{sei[:-1]}е', '.СеД'), WordForm(f'{sei[:-1]}у', '.СеВ'), WordForm(f'{sei[:-1]}ой', '.СеТ1'), WordForm(f'{sei[:-1]}ою', '.СеТ2'), WordForm(f'{sei[:-1]}ей', '.СеТ3'), WordForm(f'{sei[:-1]}ею', '.СеТ4'), WordForm(f'{sei[:-1]}е', '.СеП'), ] return word_forms