Registry /
other / lucene-analyzers-smartcn
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SmartChineseAnalyzer
✓ org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer
Tokenizes Chinese text using SmartChineseAnalyzer.
import org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import java.io.StringReader;
public class Quickstart {
public static void main(String[] args) throws Exception {
SmartChineseAnalyzer analyzer = new SmartChineseAnalyzer();
TokenStream ts = analyzer.tokenStream("text", new StringReader("我爱编程"));
CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
ts.reset();
while (ts.incrementToken()) {
System.out.println(termAtt.toString());
}
ts.end();
ts.close();
analyzer.close();
}
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.