amutu / zhparser

zhparser is a PostgreSQL extension for full-text search of Chinese language
Other
699 stars 84 forks source link

下划线的处理 #36

Closed inshua closed 2 years ago

inshua commented 5 years ago

默认是不支持 _ 切词的,我在 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)
zlianzhuang commented 2 years ago

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