使用最大匹配的python中的简单泰语wordcut

pythaiwordcut的Python项目详细描述


python中的pythaiwordcut-泰语单词cut

Codacy BadgePyPI - DownloadsPyPI - LicensePyPI - Python Version


用Python编写的一个简单的泰语分词,基于最大匹配算法 是的。Uses Lexitron(按{a3})字典作为默认

Please note: This project is under development and should not be use in production , all function and interface are subject to change. If you have issue or suggestion please feel free to ask, contribution is also very welcome :)

安装

pip install pythaiwordcut

git clone https://github.com/zenyai/pythaiwordcut.git
python setup.py install

用法

importpythaiwordcutaspwtpt=pwt.wordcut(removeRepeat=True,stopDictionary="<full path to txt file>",removeSpaces=True,minLength=1,stopNumber=False,removeNonCharacter=False,caseSensitive=True,ngram=(1,2),negation=False)print"|".join(pt.segment(u'ทดสอบการตัดคำ'))
  • removepeat:删除意图插入拼写错误,例如(_____)
  • Stc字典:删除在这个指定文本文件(一个单词一行)中存在的单词
  • Removespaces:删除空白空间
  • minlength:每个单词的最小长度
  • 停止号:如果存在则删除编号
  • removenoncharacter:删除不是泰语或英语字符的字符
  • 区分大小写:如果设置为false,将删除停止字而不考虑大小写
  • ngram:从(1,2)中添加单词ngram
  • 否定:如果设置为true,则它将在否定词和空格后的每个单词中添加not_

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

推荐PyPI第三方库


热门话题
java Jetty:以编程方式停止会导致“1个线程无法停止”   java将位图对象转换为有问题的base64字符串   java Hibernate JPA映射具有一个值为列表的映射   java I无法将数据写入多个客户端小程序   mysql Java更新查询并非每次都有效   java佯装客户端和来自属性的名称   java DatainputStream的readUTF()方法单独读取文本数据,将报告EOF异常。为什么?   Java Date getTime函数返回负值   java为什么我的var返回不兼容问题出现错误13?   使用反射将List<SomeObject>作为参数的java How get方法   java处理与改型不一致的API响应   从BuffereImage渲染精灵时出现java问题   添加删除端点时,由于Spring MVC中的MIME类型,java资源被阻止   java在变量声明中使用double vs double   java itext和dotmatrix打印机   java如何在google cloud storage builder中设置项目ID?   ResourceConfig中的java依赖解析程序   java从NetBeans启动ImageJ插件会抛出一个JNI错误。仅从ImageJ启动它就可以了