Chris Birchall created MAHOUT-1123:
--------------------------------------
Summary: Support Lucene 3.6 analyzers for vectorization
Key: MAHOUT-1123
URL: https://issues.apache.org/jira/browse/MAHOUT-1123
Project: Mahout
Issue Type: Improvement
Affects Versions: 0.7
Reporter: Chris Birchall
Passing a Lucene analyzer class name to Mahout (e.g. seq2sparse --analyzerName)
results in failure with the error shown below.
This is caused by Mahout trying to instantiate the analyzer using a
zero-argument constructor. The zero-arg constructors were removed from the
standard Lucene analyzers in Lucene 3.6 (if I recall correctly).
This patch adds support for the new one-arg constructors, as well as keeping
support for the legacy analyzers.
=====
Exception in thread "main" java.lang.IllegalStateException:
java.lang.NoSuchMethodException:
org.apache.lucene.analysis.standard.StandardAnalyzer.<init>()
at org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:68)
at
org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles.run(SparseVectorsFromSequenceFiles.java:204)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at
org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles.main(SparseVectorsFromSequenceFiles.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:195)
Caused by: java.lang.NoSuchMethodException:
org.apache.lucene.analysis.standard.StandardAnalyzer.<init>()
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getConstructor(Class.java:1657)
at org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:62)
... 11 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira