Created
October 9, 2012 05:36
-
-
Save nathanchen/3856813 to your computer and use it in GitHub Desktop.
JAVA - Lucene Fenci Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) throws IOException | |
| { | |
| Analyzer analyzer = new PaodingAnalyzer(); | |
| // String indexString = "被子U盘你平方米包的关于番禺供/电局增加乙类工作票签发人的请示西班牙语能源部九阳兔毛高筒雪地靴"; | |
| String indexString = "九阳"; | |
| StringReader reader = new StringReader(indexString); | |
| TokenStream ts = analyzer.tokenStream(indexString, reader); | |
| CharTermAttribute charTermAttribute = ts.addAttribute(CharTermAttribute.class); | |
| while (ts.incrementToken()) { | |
| String term = charTermAttribute.toString(); | |
| System.out.println(term); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment