Giter Club home page Giter Club logo

acfilter's Introduction

1:
    acfilter 用于实现查询某段文本中是否含有指定的词(当前禁词越来越多的情况下,
    是有必要开发一个扩展来干这个了): ;在词库够大的情况下,能实现一定的分词的功能;
2:
    acfilter 基于发布于http://code.google.com/p/pysoft/ 上的acseg完成,原有代码发布的license为New BSD license;
    acfilter 仍使用New BSD lincense;
3:
    安装:
    tar -xzf acfilter.tar.gz
    cd acfilter
    phpize
    ./configure
    make
    sudo make install
    安装完之后请在php.ini里加上:
    extension=acfilter.so 
4:使用:
    示例代码:
    $ac=acfilter_new();
    var_dump($ac);
    acfilter_add_word($ac,"河边");
    acfilter_add_word($ac,"狗屎");
    acfilter_add_word($ac,",");
    acfilter_add_word($ac,"工信部");
    acfilter_prepare($ac);
    print_r(acfilter_check_text($ac,"曾经有一个很狗屎的部门,叫工信部,到河边自杀了"));
    acfilter_close($ac);
    运行后输出为包含的各个禁词用空格连起来的一个字符串,如下所示:
    resource(4) of type (Acfilter Index)
    狗屎 , 工信部 , 河边

    具体可参见example.php;
5:
    有任何Bug,请发信给:[email protected],谢谢!


====Change log ======
2010.09.17
    新增一个功能点:以前只能检测完全相同的匹配,现在可以检测类似"共*产*党"这样的敏感词;

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.