amutu / zhparser

zhparser is a PostgreSQL extension for full-text search of Chinese language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

下划线的处理

inshua opened this issue · comments

默认是不支持 _ 切词的,我在 postgres.conf 开启了 zhparser.multi_duality=on 选项后,切得的词包括原始文字,不知为何。

vt=# SELECT * FROM ts_parse('zhparser', 'hello world');
 tokid | token
-------+-------
   101 | hello
   101 | world
(2 rows)

vt=# SELECT * FROM ts_parse('zhparser', 'hello_world');
 tokid |    token
-------+-------------
   101 | hello_world
   101 | hello
   101 | world
(3 rows)

我们是用的SCWS库. zhparser是对其进行了封装,可以升级到最新的SCWS库,或是修改SCWS的代码.