zhparser is a PostgreSQL extension for full-text search of Chinese language
2.9K
zhparser is a PostgreSQL extension for full-text search of Chinese language, more info: https://github.com/amutu/zhparser
debian-12 bookworm for postgresql-15,postgresql-16 and debian-11 bullseye for postgresql-15, postgresql-16 supported.
Dockerfile: https://github.com/amutu/zhparser/tree/master/docker
This docker images build based on offical postgresql images, so more about the images see : https://hub.docker.com/_/postgres
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 行记录)
more usage: https://github.com/amutu/zhparser/blob/master/README.md
Content type
Image
Digest
sha256:0b29eeef5…
Size
97.5 MB
Last updated
over 2 years ago
docker pull zhparser/zhparser:alpine-16