如果Lucene ShingleFilter可用于将字符串标记为不同大小的瓦片或ngram,例如:
"please divide this sentence into shingles"变成:
shingles "please divide", "divide this", "this sentence", "sentence into", and "into shingles"有没有人知道这是否可以与其他分析器结合使用,以返回发现的二元或三元语法的频率,例如:
"please divide this please divide sentence into shingles"会为“请除”返回2吗?
我应该补充说,我的字符串是从数据库构建的,然后由Lucene在内存中索引,并且不是持久化的。不打算使用其他产品,如Solr。
发布于 2012-09-07 07:48:22
我最终将snowballAnalyzer和standardAnalyzers作为参数传递给ShingleFilterWrappers,并通过TermVectorMapper处理输出。
https://stackoverflow.com/questions/12250275
复制相似问题