纯python模块连接文本

Pyphen的Python项目详细描述


Pyphen是一个纯python模块,用现有的HunScript来连接文本。 断字词典。

https://github.com/Kozea/Pyphen

这个模块是由wilbert berendsen编写的python断字器的叉。

https://code.google.com/p/python-hyphenator/

很多字典都包含在pyphen中,它们来自libreoffice git 存储库,并在gpl、lgpl和/或mpl下分发。见 字典和libreoffice的存储库了解更多详细信息。

http://cgit.freedesktop.org/libreoffice/dictionaries/tree/

用法:

>>> import pyphen
>>> pyphen.language_fallback('nl_NL_variant1')
'nl_NL'
>>> 'nl_NL' in pyphen.LANGUAGES
True
>>> dic = pyphen.Pyphen(lang='nl_NL')
>>> dic.inserted('lettergrepen')
'let-ter-gre-pen'
>>> dic.wrap('autobandventieldopje', 11)
('autoband-', 'ventieldopje')
>>> for pair in dic.iterate('Amsterdam'):
...     print(pair)
...
('Amster', 'dam')
('Am', 'sterdam')
>>>

功能:

  • 100%纯python,无依赖关系
  • 包括许多词典
  • 缓存dict文件和连字符单词
  • 支持非标准连字符模式

许可证:

Pyphen是在GPL 2.0+/LGPL 2.1+/MPL 1.1三方许可下发布的。 有关详细信息,请参见copying.gpl、copying.lgpl和copying.mpl。

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

推荐PyPI第三方库


热门话题
java如何修改打印板?   java Spring批处理JdbcCursorItemReader还是RepositoryItemReader?   java如何在JTable Swing中增加标题列的字体?   java在数组方面遇到问题,导致表达式非法启动   java如何为maven pom的某些部分关闭Eclipse代码格式化程序。xml   java Dropwizard登录代码   java Jersey 2.22:客户端的默认连接超时是多少?   java无法自动连接字段:javax。sql。数据来源   如何从java中的行列表中获取单词列表?   java JDBC批量更新和处理异常?   计算大根:bigdecimal/java   java如何在JavaCC语法中提到trycatch块   javasocket。getInetAddress()不返回任何内容   oracle SQL开发人员错误无法找到Java虚拟机   java我如何计算和显示未来5年每一年的投资价值   java如何关闭浏览器选项卡?   java如何在showMessageDialog中打印双2D数组?   java从站点抓取播放列表URL?   selenium中的java点击css按钮