Skip to main content

a python chinese seg word

Project description

scseg
========
scseg中文分词,是基于mmseg的简单分词组件


Feature
========
* 支持pinyin分词
* 支持用户自定义词典
* 支持单位合并
* 支持汉字数字识别

Install
==========
* `pip install scseg`
* 通过`import scseg`来引用


Algorithm
==========
* 采用mmseg算法进行切分
* 采用规则方式支持中文数字分词

功能 1):分词`scseg.seg_text`方法
==============

* `scseg.seg_text`函数接受3个参数:
* `text`参数为需要分词的字符
* `ext_dict_words`为用户自定义的扩展字典
* `use_combine`代表是否需要合并处理

代码示例( 全功能分词 )

#encoding=utf-8
import genius

seg_list = scseg.seg_text(u'中国人民站起来了pinyin')
print '\n'.join(seg_list)


功能 2):面向索引的分词
==============
* `scseg.seg_keywords`为面向索引的切割方式
* 其作用是枚举出所有可能的切割方式
* `text`参数为需要分词的字符

代码示例( 全功能分词 )

#encoding=utf-8
import scseg

seg_list = scseg.seg_keywords(u'中国人民站起来了pinyin')
print '\n'.join(seg_list)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scseg-1.7.4.tar.gz (1.6 MB view details)

Uploaded Source

File details

Details for the file scseg-1.7.4.tar.gz.

File metadata

  • Download URL: scseg-1.7.4.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scseg-1.7.4.tar.gz
Algorithm Hash digest
SHA256 185308100e4e134f69e8a3437cd70a2a2755e6e808f19281a21ccfbedb884f39
MD5 fe2f9a15cf402b6c27e4442300c3e6b2
BLAKE2b-256 766d7bd6f514395eb25917724dd6f9c5e8121bdc87b8ae20bcd34adfad42000e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page