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

Shai Erera commented on LUCENE-1540:
------------------------------------

Patch looks good !

Few comments:

In TrecFTParser.parse(), I think you can extract the logic which finds the date 
and title into a common method which receives the strings to look for as 
parameters (e.g. find(String str, String start, int startlen, String end))? 
Then the code can be simplified to:
{code}
Date date = trecSrc.parseDate(find(dobBuf, DATE, DATE_LENGTH, DATE_END));
String title = find(docBuf, HEADLINE, HEADLINE_LENGTH, HEADLINE_END);
{code}

I believe this method will be useful for other parsers as well, so might be 
good to pull it up to the abstract TrecDocParser (and +1 for making it abstract 
and moving logic from TCS to it).

In TrecContentSource you changed rawDocSize from int to int[], however it's an 
array that's always allocated at size 1 and never resized. I think it can be an 
int?

Also, TCS.cleanTags has two versions, one taking a String and one a 
StringBuilder (took me a minute to notice the difference) -- do you think the 
performance gain (of not allocating a String in the SB variant) is worth the 
code dup? I didn't understand what does cleanTags do - does it strip tags off 
of the HTML content?

I would also make all those static methods public (and move them to 
TrecDocParser) in case someone wants to impl his own parser.

Thanks for adding support for GZIP in ContentSource - I had this on my TODO 
list for a long time :). Two things:
# I think the try-catch can be extracted to wrap the 'switch' because it is now 
needed by both BZIP and GZIP.
# Is it possible to add support for ZIP as well? If it's not trivial, then 
let's resolve it in a different issue.

> Improvements to contrib.benchmark for TREC collections
> ------------------------------------------------------
>
>                 Key: LUCENE-1540
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1540
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: contrib/benchmark
>            Reporter: Tim Armstrong
>            Assignee: Doron Cohen
>            Priority: Minor
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-1540.patch, LUCENE-1540.patch
>
>
> The benchmarking utilities for  TREC test collections (http://trec.nist.gov) 
> are quite limited and do not support some of the variations in format of 
> older TREC collections.  
> I have been doing some benchmarking work with Lucene and have had to modify 
> the package to support:
> * Older TREC document formats, which the current parser fails on due to 
> missing document headers.
> * Variations in query format - newlines after <title> tag causing the query 
> parser to get confused.
> * Ability to detect and read in uncompressed text collections
> * Storage of document numbers by default without storing full text.
> I can submit a patch if there is interest, although I will probably want to 
> write unit tests for the new functionality first.

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

        

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

Reply via email to