ITPub博客

首页 > 数据库 > > 词典-停用词

词典-停用词

作者:GaussDB_数据库 时间:2020-01-16 09:05:11 0 删除 编辑

停用词是很常见的词,几乎出现在每一个文档中,并且没有区分值。因此,在全文搜索的语境下可忽视它们。停用词处理逻辑和词典类型相关。例如,Ispell词典会先对标记进行规范化,然后再查看停用词表,而Snowball词典会最先检查输入标记是否为停用词。

例如,每个英文文本包含像a和the的单词,因此没必要将它们存储在索引中。然而,停用词影响tsvector中的位置,同时位置也会影响相关度:

SELECT to_tsvector('english','in the list of stop words');
to_tsvector
----------------------------
'list':3 'stop':5 'word':6

位置1、2、4是停用词,所以不显示。为包含和不包含停用词的文档计算出的排序是完全不同的:

SELECT ts_rank_cd (to_tsvector('english','in the list of stop words'), to_tsquery('list & stop'));
ts_rank_cd
------------
.05
SELECT ts_rank_cd (to_tsvector('english','list stop words'), to_tsquery('list & stop'));
ts_rank_cd
------------
.1


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3139532/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 触发器的创建
下一篇: 产品文档术语-Z
请登录后发表评论 登录
全部评论

注册时间:2020-01-06

  • 博文量
    2907
  • 访问量
    19318