lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-1804) Upgrade Carrot2 to 3.2.0
Date Wed, 08 Jun 2011 22:45:59 GMT

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

Robert Muir commented on SOLR-1804:
-----------------------------------

{quote}
Yup, e.g. Lists.newArrayList() -> new ArrayList<Entry>() : <http://svn.apache.org/viewvc/lucene/dev/trunk/modules/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTLookup.java?r1=1097216&r2=1126642&diff_format=h#l154>.
{quote}

Well not just that, e.g.:
{code}
final List<String> input = Lists.newArrayList(Iterables.transform(benchmarkInput, new
Function<TermFreq, String>() {
  public String apply(TermFreq tf) {
    return tf.term.substring(0, Math.min(tf.term.length(),
        minPrefixLen + random.nextInt(maxPrefixLen - minPrefixLen + 1)));
  }
}));
{code}

versus

{code}
final List<String> input = new ArrayList<String>(benchmarkInput.size());
for (TermFreq tf : benchmarkInput) {
  input.add(tf.term.substring(0, Math.min(tf.term.length(),
      minPrefixLen + random.nextInt(maxPrefixLen - minPrefixLen + 1))));
}
{code}

One of these any of us can look at instantly and know whats going on. The other is more like
the C++ STL,
sure if the developer is really cautious and it doesnt go out of hand it *might* stay understandable.

I suppose in all this refactoring, I didn't see what Guava bought us at all, except extra
method calls. Guess
I'm just not a fan.

http://svn.apache.org/viewvc/lucene/dev/trunk/modules/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java?r1=1097216&r2=1126642&diff_format=h



> Upgrade Carrot2 to 3.2.0
> ------------------------
>
>                 Key: SOLR-1804
>                 URL: https://issues.apache.org/jira/browse/SOLR-1804
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - Clustering
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>             Fix For: 3.1, 4.0
>
>         Attachments: SOLR-1804-carrot2-3.4.0-dev-trunk.patch, SOLR-1804-carrot2-3.4.0-dev.patch,
SOLR-1804-carrot2-3.4.0-libs.zip, SOLR-1804.patch, carrot2-core-3.4.0-jdk1.5.jar
>
>
> http://project.carrot2.org/release-3.2.0-notes.html
> Carrot2 is now LGPL free, which means we should be able to bundle the binary!

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message