zhuixun / ik-analyzer

Automatically exported from code.google.com/p/ik-analyzer
0 stars 0 forks source link

若支持 Lucene 3.5 #46

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

Exceptions:
java.lang.AssertionError: Analyzer implementation classes or at least their 
tokenStream() and reusableTokenStream() implementation
s must be final
    at org.apache.lucene.analysis.Analyzer.assertFinal(Analyzer.java:59)
    at org.apache.lucene.analysis.Analyzer.<init>(Analyzer.java:45)
    at org.wltea.analyzer.lucene.IKAnalyzer.<init>(IKAnalyzer.java:65)
    at org.wltea.analyzer.lucene.IKAnalyzer.<init>(IKAnalyzer.java:56)

java.lang.AssertionError: TokenStream implementation classes or at least their 
incrementToken() implementation must be final
    at org.apache.lucene.analysis.TokenStream.assertFinal(TokenStream.java:119)
    at org.apache.lucene.analysis.TokenStream.<init>(TokenStream.java:92)
    at org.apache.lucene.analysis.Tokenizer.<init>(Tokenizer.java:41)
    at org.wltea.analyzer.lucene.IKTokenizer.<init>(IKTokenizer.java:20)
    at org.wltea.analyzer.lucene.IKAnalyzer.reusableTokenStream(IKAnalyzer.java:52)
    at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:126)
    at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:278)
    at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:766)
    at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066)
    at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2040)
--------------------------------------------------------------------
Solution
1. change org.wltea.analyzer.lucene.IKAnalyzer to "final"
2. change org.wltea.analyzer.lucene.IKTokenizer to "final"
--------------------------------------------------------------------
Test
Not tested yet.

Original issue reported on code.google.com by english....@gmail.com on 24 Mar 2012 at 2:12

GoogleCodeExporter commented 8 years ago

Original comment by linliang...@gmail.com on 25 Mar 2012 at 6:52

GoogleCodeExporter commented 8 years ago

Original comment by linliang...@gmail.com on 26 Mar 2012 at 1:39