雙拼輸入法學習-搜狗方案-3

鍵位圖

在這裏插入圖片描述

口訣

在這裏插入圖片描述
口訣含義,自己想的
在這裏插入圖片描述

練習程序

# -*- coding: utf-8 -*-

# @Author  : billy
# @Email   : [email protected]

# Q秋 W娃丫 E娥 R遠觀 T月     Y域外 U舒 I馳 O嗅臥 P雲昆
# A阿 S勇送, D汪洋 F分       G更 H航 J岸 K靠 L來
# z賊 X卸 C笑 V追             B慪 N您 M眠

import random
keymapStr = \
    '''
iu->q->秋
ia->w->丫
ua->w->娃
e->e->娥
er->r->遠觀
uan->r->遠觀
ve->t->月
ue->t->月
v->y->域
uai->y->外
sh->u->舒
ch->i->馳
uo->o->嗅臥
o->o->嗅臥
un->p->雲昆
a->a->阿
ong->s->勇送
iong->s->勇送
ing->d->汪洋
uang->d->汪洋
iang->d->汪洋
en->f->分
eng->g->更
ang->h->航
an->j->岸
ao->k->靠
ai->l->來
ei->z->賊
ie->x->卸
iao->c->笑
zh->v->追
ui->v->追
ou->b->慪
in->n->您
ian->m->眠
    '''
noteStr = \
    '''
iu->秋 ,1.秋娃丫娥遠觀月
ia->丫 ,1.秋娃丫娥遠觀月
ua->娃 ,1.秋娃丫娥遠觀月
e->娥 ,1.秋娃丫娥遠觀月
er->遠觀 ,1.秋娃丫娥遠觀月
uan->遠觀 ,1.秋娃丫娥遠觀月
ve->月 ,1.秋娃丫娥遠觀月
ue->月 ,1.秋娃丫娥遠觀月
v->域 ,2.域外舒馳噢臥雲昆
uai->外 ,2.域外舒馳噢臥雲昆
sh->舒 ,2.域外舒馳噢臥雲昆
ch->馳 ,2.域外舒馳噢臥雲昆
uo->嗅臥 ,2.域外舒馳噢臥雲昆
o->嗅臥 ,2.域外舒馳噢臥雲昆
un->雲昆 ,2.域外舒馳噢臥雲昆
a->阿 ,3.阿勇送,
ong->勇送 ,3.阿勇送,
iong->勇送 ,3.阿勇送,
uang->汪洋 ,3.汪洋分
iang->汪洋 ,3.汪洋分
en->分 ,3.汪洋分
eng->更 ,4.更航岸靠來
ang->航 ,4.更航岸靠來
an->岸 ,4.更航岸靠來
ao->靠 ,4.更航岸靠來
ai->來 ,4.更航岸靠來
ei->賊 ,5.賊缷邀追
ie->卸 ,5.賊缷邀追
iao->邀 ,5.賊缷邀追
zh->追 ,5.賊缷邀追
ui->追 ,5.賊缷邀追
ou->慪 ,6.慪您眠
in->您 ,6.慪您眠
ian->眠 .6.慪您眠
    '''

lines = keymapStr.strip().split('\n')
keyMapDict = {}
noteDict = {}
for lines in lines:
    split = lines.split("->")
    key = split[0].lstrip()  # 去掉左邊的空格
    value = split[1]
    keyMapDict.update({key: value})

lines = noteStr.strip().split('\n')
noteDict = {}
for lines in lines:
    split = lines.split("->")
    key = split[0].lstrip()  # 去掉左邊的空格
    value = split[1]
    noteDict.update({key: value})

print("------開始練習-------")
print("秋娃丫娥遠觀月 域外舒馳噢臥雲昆")
print("阿勇送,汪洋分 更航岸靠來")
print("賊缷邀追 慪您眠")

# 提示輸入
while True:
    randomKey = random.choice(list(keyMapDict.keys()))
    correctValue = keyMapDict.get(randomKey)
    note = noteDict.get(randomKey)

    print("韻母/聲母:{}  {}".format(randomKey, note))
    inputValue = input("輸入鍵位:")

    if inputValue == correctValue:
        print("success !")
        pass
    else:
        print("error !")
    print()

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章