Giter VIP home page Giter VIP logo

libcppjieba's Introduction

Build Status


libcppjieba

简介

CppJieba 项目里面抽取出来的源代码,单独抽出来成立项目,使得它更容易去理解和使用。
如果你喜欢该项目,请 star CppJieba 而不是该项目,以助于 CppJieba 的传播和更好的后续改进。多谢。

特性

  • 源代码全是头文件(hpp),全在 include/ 目录里。只需要 #include 即可使用。 没有链接,就没有伤害。
  • 无需安装其他任何依赖库,没错,连 boost 也不需要,是不是很酷。
  • 支持 utf-8 编码。

用法

make 
./demo

详细示例代码请看 demo.cpp

常见问题

问题1:
编译器报错 can not find tr1/unordered_map 或者其他关于 tr1 的错误。 解决:
添加编译选项 -std=c++0x (或者 -std=c++11),比如 g++ -o demo -std=c++0x demo.cpp

问题2:
如何设置 logger 级别?
解决:
添加编译选项 -DLOGGER_LEVEL=LL_WARN 就是设置日志级别为 WARN 及 WARN 以上。 同理可得 LL_DEBUG, LL_INFO, LL_ERROR, LL_FATAL

鸣谢

客服

libcppjieba's People

Contributors

yanyiwu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libcppjieba's Issues

加上-std=c++0x 或者-std=c++11编译错误

Ubuntu 12.04LTS
g++: 4.6.4

编译错误信息如下:
In file included from ./include/MixSegment.hpp:5:0,
from demo.cpp:5:
./include/MPSegment.hpp: In member function ‘bool CppJieba::MPSegment::cut(Limonp::LocalVector::const_iterator, Limonp::LocalVector::const_iterator, std::vector<Limonp::LocalVector >&) const’:
./include/MPSegment.hpp:103:106: error: no matching function for call to ‘make_pair(size_t&, NULL)’
./include/MPSegment.hpp:103:106: note: candidate is:
/usr/include/c++/4.6/bits/stl_pair.h:262:5: note: template<class _T1, class _T2> std::pair<typename std::__decay_and_strip<_T1>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
make: *** [all] Error 1

-std=c++11是在ubutnu14.04上测试的,错误相同

是否有buffer的限制

如题,是否有buffer的限制,在原始cppjieba中max_word_length=512,在这个版本中是否有此限制?

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.