汉字五笔转换模块/工具.

pywubi的Python项目详细描述


汉字五笔转换工具(Python 版)

pypipython_vesion

将汉字转为五笔码。现只支持 86 版编码。(ps:因为找到整理出 86 版五笔编码)

关于

特性

  1. 将词组转成五笔编码。比如词语:生死有命。换成五笔码为:'tgdw';
  2. 返回汉字的所有可能的编码。如汉字:为 。换成五笔码为: 'ylyi', 'yly', 'yl', 'o';
  3. 将一段句子,转成五笔码。如:天气不错,我们去散步吧!:五笔码为:'gdi', 'rnb', 'gii', 'qajg', ',', 'trnt', 'wun', 'fcu', 'aety', 'hir', 'kcn', '!'

安装

$ pip install pywubi

使用示例

>>> from pywubi import wubi
>>> wubi('我爱你')
['trnt', 'epdc', 'wqiy']
>>> wubi('我爱你',multicode=True)  # 返回汉字的所有可能的五笔编码
[['trnt', 'trn', 'q'], ['epdc', 'epd', 'ep'], ['wqiy', 'wqi', 'wq']]
>>> wubi('我爱你', single=False) # 以词组的方法处理这些汉字
['tewq']

Lincese

MIT License

Copyright (c) 2019  Thunder Bouble

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

推荐PyPI第三方库


热门话题
来自Oozie Java Jobs的电子邮件   泛型Java映射。具有有界通配符的getOrDefault   java如何制作定制的Swing容器?   java断言使用正则表达式重新启动响应体   安卓 java正则表达式查找字符串中的所有空格   java循环语法不起作用   使用spring4@Transactional时,java事务不起作用   java三桨乒乓球命中检测   java Camera 2 Api错误不拍照的错误   java使用ServletContext从war外部读取Hibernate属性   性能如何禁用Java垃圾回收器?   如何通过MySQL触发器执行外部java函数?   使用Ecfbittorent下载torrent时出现java NegativeArraySizeException   java Android arraylist因迭代而崩溃   MyBatis中的java Delete查询没有删除任何内容