[ 
https://issues.apache.org/jira/browse/MAHOUT-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499346#comment-13499346
 ] 

Grant Ingersoll commented on MAHOUT-1112:
-----------------------------------------

Starting to review, seems like we could put together a few utility classes to 
reduce the amount of repeated code (which was in there before), i.e.:

{code}
if (analyzerName.equals(StandardAnalyzer.class.getName())) {
            Class<?>[] params = new Class<?>[1];
            params[0] = Version.class;
            Object[] args = new Object[1];
            args[0] = Version.LUCENE_40;

            analyzer = 
ClassUtils.instantiateAs(context.getConfiguration().get(DocumentProcessor.ANALYZER_CLASS,
                    StandardAnalyzer.class.getName()),
                    Analyzer.class, params, args);

        } else {
            analyzer = ClassUtils.instantiateAs(analyzerName, Analyzer.class);
        }
{code}

I see code like that in a few places.  Maybe an AnalyzerUtils?

I'll try to get to it next week, but if you want to go for it Andrew, that 
would be great.

We also seem to have some inconsistent usage around creating analyzers.  In 
some cases, we check if it is StdAnalyzer, in other places we don't.

Also, a quick scan of most analyzers in 4 indicate they take in Version, etc.  
We probably should figure out some better way to instantiate Analyzers.


                
> Migrate code from Lucene / Solr 3.6 to 4.0.0
> --------------------------------------------
>
>                 Key: MAHOUT-1112
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1112
>             Project: Mahout
>          Issue Type: Task
>    Affects Versions: 0.8
>            Reporter: Andrew Janowczyk
>            Assignee: Grant Ingersoll
>             Fix For: 0.8
>
>         Attachments: mahout-lucene-3.6-to-4.0.0-v2.patch
>
>   Original Estimate: 20h
>  Remaining Estimate: 20h
>
> Lucene/Solr 4.0.0 was released on October 12, 2012 
> Many of the functionalities have changed, so it wasn't an easy migration.
> I'm including a patch, which passes all junit tests, for review.

--
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

Reply via email to