博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
lucene 分词相关的类
阅读量:7127 次
发布时间:2019-06-28

本文共 2023 字,大约阅读时间需要 6 分钟。

TokemStream

org.apache.lucene.analysis.TokenStream

一个
抽象类。一个TokenStream会枚举若干个token的序列,要么来自文档的域,要门来自查询文本。

A TokenStream enumerates the sequence of tokens, either from Fields of a Document or from query text. 

TokenStream org.apache.lucene.analysis.Analyzer.tokenStream(String fieldName, Reader reader)

从reader的文本中得到一个Analyzer分词后的TokenStream。
Creates a TokenStream which tokenizes all the text in the provided Reader.

void org.apache.lucene.analysis.TokenStream.reset() throws IOException

将TokenStream的游标重置到初始位置。
Resets this stream to the beginning.

boolean org.apache.lucene.analysis.TokenStream.incrementToken() throws IOException

消费者,也就是IndexWriter使用这个方法来获得下一个token。
Consumers (i.e., IndexWriter) use this method to advance the stream to the next token. 
org.apache.lucene.analysis.tokenattributes.CharTermAttribute
一个token的词文本。
The term text of a Token.

<CharTermAttribute> CharTermAttribute org.apache.lucene.util.AttributeSource.getAttribute(Class<CharTermAttribute> attClass)
获得指定的Attribute。
The caller must pass in a Class<? extends Attribute> value. Returns the instance of the passed in Attribute contained in this AttributeSource。

Tokenizer

org.apache.lucene.analysis.
Tokenizer
一个Tokenizer是一个输入为Reader的
TokenStream
A Tokenizer is a TokenStream whose input is a Reader. 

TokenFilter

org.apache.lucene.analysis.
TokenFilter
一个TokenFilter是一个输入为其他TokenStream的TokenStream。用于过滤。
A TokenFilter is a TokenStream whose input is another TokenStream. 
org.apache.lucene.analysis.
LowerCaseFilter
将token替换为小写。
Normalizes token text to lower case. 
org.apache.lucene.analysis.
StopFilter
从一个TokenStream中去除停用词。
Removes stop words from a token stream. 

Analyzer

org.apache.lucene.analysis.
KeywordAnalyzer
将整个stream作为一个token。适用于邮政编码、产品名称等。
"Tokenizes" the entire stream as a single token. This is useful for data like zip codes, ids, and some product names.
org.apache.lucene.analysis.
ReusableAnalyzerBase
一个Analyzer的方便的子类,可以方便地实现TokenStream的重用。
An convenience subclass of Analyzer that makes it easy to implement TokenStream reuse.

转载地址:http://xvoel.baihongyu.com/

你可能感兴趣的文章
专访孙睿 :能做自己,去做自己想做的,是件挺幸福的事儿
查看>>
滴滴开源跨平台统一 MVVM 框架 Chameleon
查看>>
玖锦科技完成1.1亿元融资,中信惠科基金领投
查看>>
JavaWeb_常用功能_01_文件上传
查看>>
Git for Windows 2.21.0 发布,Win 下的 Git 客户端
查看>>
JSON和XML格式转换
查看>>
XXL-RPC v1.3.2,分布式服务框架
查看>>
将c++静态库实现二次封装供java调用
查看>>
在阿里云kubernetes上部署Jenkins Master
查看>>
VueJs开发笔记—IDE选择和优化、框架特性、数据调用、路由选项及使用
查看>>
MySQL 数据库的备份与恢复
查看>>
Android中的设计模式之单例模式
查看>>
使用Cordova将您的前端JavaScript应用打包成手机原生应用
查看>>
用Python玩转微信
查看>>
Bootstrap 小结
查看>>
《JavaScript权威指南》——JavaScript核心
查看>>
C语言 时间函数的学习
查看>>
你真的懂Redis事务吗?
查看>>
收藏 | 12个ggplot2拓展程序助你强化R可视化
查看>>
1-Linux C语言编程基本原理与实践-学习笔记
查看>>