支持plover的python字典

plover-python-dictionar的Python项目详细描述


为plover添加对python字典的支持。

用法

python字典只是一个具有以下api的模块:

# Length of the longest supported key (number of strokes).LONGEST_KEY=1# Lookup function: return the translation for <key> (a tuple of strokes)# or raise KeyError if no translation is available/possible.deflookup(key):assertlen(key)<=LONGEST_KEYraiseKeyError# Optional: return an array of stroke tuples that would translate back# to <text> (an empty array if not possible).defreverse_lookup(text):return[]

例如,将以下代码保存到show_stroke.py

LONGEST_KEY=2SHOW_STROKE_STENO='STR*'deflookup(key):assertlen(key)<=LONGEST_KEY,'%d/%d'%(len(key),LONGEST_KEY)ifSHOW_STROKE_STENO!=key[0]:raiseKeyErroriflen(key)==1:return' 'returnkey[1]

然后把它像普通字典一样添加到字典堆栈中。

现在,如果您笔划STR*,则下一个笔划将逐字显示 (未翻译),例如-T STROEBG TP-RKW-GS STROEBG KR-GS S STR* STROEBG 输出:the stroke for "stroke" is STROEBG

发布历史记录

0.5.10

  • 修复/setup.py测试处理
  • 修复反向查找的默认实现以返回列表(不是元组)

0.5.9

  • 更新到Plover的最新API

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在创建对话框时设置模糊背景   java支持clojure中的xml和json REST响应   java在Android中通过多个JSON对象循环   java如何创建T类型的新对象   Java应用程序的设计   java使用GridView、适配器和毕加索制作流行电影应用程序   java在映射中交换值   java在同一活动/布局中多次使用同一片段   使用FixedLengthTokenizer使用java Spring FlatFileItemReader   javajavax。xml。ws。WebServiceException:javax。xml。肥皂SOAPException:错误代码QName必须是命名空间限定的!在weblogic server 12c中部署时   当我在构造函数中调用java Autowired属性时,该属性为null   线程“main”java中的linux异常。网BindException:地址已在使用中   java检查两个日期周期是否重叠   有没有办法通过安卓应用程序自动检测java服务器应用程序是否在线?   java检查2D数组中4个连续相同的对角线元素(连接4个游戏)   向Java数组添加数据   java组织。弹性搜索。客户运输NoNodeAvailableException:配置的节点均不可用:[]