{"repo":"amutu/zhparser","free":true,"listed":false,"github":"https://github.com/amutu/zhparser","clone":"git clone https://github.com/amutu/zhparser.git","description":"zhparser is a PostgreSQL extension for full-text search of Chinese language","language":"C","stars":870,"topics":["zhparser","scws","postgresql","extension","chinese","chinese-text-segmentation","chinese-nlp"],"license":null,"category":"databases-storage","readme_excerpt":"Zhparser ======== Zhparser is a PostgreSQL extension for full-text search of Chinese language (Mandarin Chinese). It implements a Chinese language parser base on the Simple Chinese Word Segmentation(SCWS). Project home page: http://blog.amutu.com/zhparser/ 注意 ：对于分词结果不满意的，或者需要调试分词结果的，可以在这个页面调试：http://www.xunsearch.com/scws/demo/v48.php Docker快速体验 ------- run the container: docker run --name pgzhparser -d -e POSTGRES PASSWORD=somepassword zhparser/zhparser:bookworm-16 login the postgres database as user postgres: docker exec -it pgzhparser psql postgres postgres create the extension and use it: CREATE EXTENSION zhparser; CREATE TEXT SEARCH CONFIGURATION testzhcfg (PARSER = zhparser); ALTER TEXT SEARCH CONFIGURATION testzhcfg ADD MAPPING FOR n,v,a,i,e,l WITH simple; SELECT FROM ts parse('zhparser', 'hello world! 2010年保障房建设在全国范围内获全面启动'); you will get: tokid token -------+------- 101 hello 101 world 117 ! 101 2010 113 年 118 保障 110 房建 118 设在 110 全国 110 范围 102 内 118 获 97 全面 118 启动 (14 行记录) 更多docker镜像信息，访问这里：zhparser的dockerub zhparser的docker镜像基于PostgreSQL的docker官方镜像构建，更多的用法参见：https://hub.docker.com/ /postgres INSTALL ------- 0.前置条件 zhparser支持PostgreSQL 9.2及以上版本，请确保你的PG版本符合要求。 对于REDHAT/CentOS Linux系统，请确保安装了相关的库和头文件，一般它们在postgresql-devel软件包中。 1.安装SCWS 2.下载zhparser源码 3.编译和安装zhparser 如果scws的路径不在默认的 /usr/local 下,可以设置SCWS HOME 例如： SCWS HOME=/usr make && make install 如果你同时安装了多个版本的PostgreSQL, 可以通过指定 PG\\ CONFIG 来为指定的版本编译扩展： 注意:在 BSD上编译安装时，使用gmake代替make 4.创建extension CONFIGURATION ------- 以下配置","default_branch":null,"files":null,"tree":[],"storefront":"/r/amutu","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/amutu/zhparser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}