Does anybody know if there is a Chinese Lucene Analyzer that is more lightweight than smartcn or if it is possible to configure smartcn to use less memory?<div><br></div><div>Smart Chinese Analyzer will not run on Android because it attempts to load up a large dictionary in order to split phrases and runs out of memory. Here is a stack trace:</div>
<div><br></div><div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): java.lang.ExceptionInInitializerError</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.hhmm.HHMMSegmenter.process(HHMMSegmenter.java:201)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.WordSegmenter.segmentSentence(WordSegmenter.java:50)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.WordTokenFilter.incrementToken(WordTokenFilter.java:69)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.PorterStemFilter.incrementToken(PorterStemFilter.java:53)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.StopFilter.incrementToken(StopFilter.java:225)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.CachingTokenFilter.fillCache(CachingTokenFilter.java:87)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.CachingTokenFilter.incrementToken(CachingTokenFilter.java:61)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:599)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1449)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1337)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1265)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1254)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:200)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.crosswire.jsword.index.lucene.LuceneIndex.find(Unknown Source)</div><div><deleted a bit of the stack trace here></div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): Caused by: java.lang.OutOfMemoryError</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at java.lang.reflect.Array.newInstance(Array.java:492)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at java.io.ObjectInputStream.readNewArray(ObjectInputStream.java:1637)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:927)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2285)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2240)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.hhmm.BigramDictionary.loadFromInputStream(BigramDictionary.java:99)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.hhmm.BigramDictionary.load(BigramDictionary.java:120)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.hhmm.BigramDictionary.getInstance(BigramDictionary.java:71)</div>
<div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): at org.apache.lucene.analysis.cn.smart.hhmm.BiSegGraph.<clinit>(BiSegGraph.java:46)</div><div>11-11 20:38:28.296: ERROR/AndroidRuntime(8925): ... 35 more</div>
<div><br></div><div>For now I will have to disable searching in Chinese texts.</div><div><br></div><div>Kind regards</div><div>Martin</div><div><br></div><div><br></div></div>