一.倒排索引 1. 构建倒排索引 例如说有下面两个句子doc1,doc2 doc1:I really liked my small dogs, and I think my mom also liked them. doc2:He never liked any dogs, so I hope that my mom will not expect me to liked him. 首先进行英文分词,这个阶段就是初步的倒排索引的建立 term doc1 doc2 I * * really * l…
Lucene-分词器API org.apache.lucene.analysi.Analyzer 分析器,分词器组件的核心API,它的职责:构建真正对文本进行分词处理的TokenStream(分词处理器).通过调用它的如下两个方法,得到输入文本的分词处理器. public final TokenStream tokenStream(String fieldName, Reader reader) public final TokenStream tokenStream(String fieldN…