如何指示Lucene中的StandardAnalyzer不要删除停用词? [英] How to instruct StandardAnalyzer in Lucene to not to remove stop words?

查看:77
本文介绍了如何指示Lucene中的StandardAnalyzer不要删除停用词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题:分析我的句子时如何使Lucene的StandardAnalyzer不删除停用词?

Simple question : How to make Lucene's StandardAnalyzer not to remove stop words when analyzing my sentence ?

推荐答案

答案取决于版本.对于 Lucene 3.0.3(当前),您需要使用一组空的停用词来构造StandardAnalyzer,如下所示:

The answer is version-dependent. For Lucene 3.0.3 (current), you need to construct the StandardAnalyzer with an empty set of stop words, using something like this:

Analyzer ana = new StandardAnalyzer(LUCENE_30, Collections.emptySet());

这篇关于如何指示Lucene中的StandardAnalyzer不要删除停用词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆