Giter VIP home page Giter VIP logo

cppjiebapy's Introduction

cppjiebapy

wrap cppjieba by swig. 若想使用python来调用cppjieba,或者像知道python调用c++的方法,可查阅此代码。

使用Python调用CppJieba方法

  • 安装swig

  • 下载cppjieba并编译安装。 https://github.com/aszxqw/cppjieba

  • 安装CppJiebaPy模块: python setup.py install

  • 调用方法: import cppjiebapy; cppjiebapy.cut

  • 测试:test/test_whoosh.py

使用了正则对输入文本进行预处理,所以使用了宏-DNO_FILTER。若想预处理url链接等可以修改正则

init.py: self.stage1_regex = re.compile('(\d+)|([a-zA-Z]+)', re.I|re.U) 为其它值。

借用swig实现Python对CppJieba的调用,没有使用Py++对整个库进行支持。

因为懒,所以目前只支持了MixSegment的模式,要支持其它模式也不难。

只支持精确分词模式

只在Linux下完成测试

#TODO

完整支持?

Support for windows?

cppjiebapy's People

Contributors

dchentech avatar jannson avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.