Re: Re: [Wyonacms-cvs-commit] lenya/src/java/org/lenya/lucene HTMLDocument.java,1.13,1.14

Michael Wechner <[email protected]> Tue, 18 Mar 2003 14:21:53 +0100
Newsgroups gmane.comp.cms.wyona.devel
Message-ID <[email protected]>
Christian Egli wrote:
> Again, sorry to be so picky but I just wish you wouldn't just produce
> dead code (i.e. commented out code). If the code is no longer used
> then remove it. To see how the code looked before use CVS.

It's NOT dead code. I am working on it and I don't think CVS is a very 
good search tool.

> 
> At least mark it with a 'FIXME:' to say what this is about and why it
> is commented out.

agreed. I will do that in the future.

> 
> IMHO code that is commented out indicates poor code quality (which we
> don't want to imply, do we :-).

better some code (that works) than no code.

Thanks

Michael



> 
> Michael Wechner <[email protected]> writes:
> 
> 
>>Update of /repository/lenya/src/java/org/lenya/lucene
>>In directory erbium:/tmp/cvs-serv469/src/java/org/lenya/lucene
>>
>>Modified Files:
>>	HTMLDocument.java 
>>Log Message:
>>uses currently HTMLParser
>>
>>Index: HTMLDocument.java
>>===================================================================
>>RCS file: /repository/lenya/src/java/org/lenya/lucene/HTMLDocument.java,v
>>retrieving revision 1.13
>>retrieving revision 1.14
>>diff -C2 -d -r1.13 -r1.14
>>*** HTMLDocument.java	14 Mar 2003 16:07:01 -0000	1.13
>>--- HTMLDocument.java	18 Mar 2003 07:43:42 -0000	1.14
>>***************
>>*** 151,154 ****
>>--- 151,155 ----
>>  
>>          // Add the title as a separate Text field, so that it can be searched separately.
>>+ /*
>>          String title = htmlDoc.getTitle();
>>  
>>***************
>>*** 158,166 ****
>>              doc.add(Field.Text("title", ""));
>>          }
>>  
>>          //System.out.println("HTMLDocument.getLuceneDocument(): title field added: " + title);
>>  
>>!         // Add the tag-stripped contents as a Reader-valued Text field so it will
>>!         // get tokenized and indexed.
>>          String body = htmlDoc.getBody();
>>          String contents = "";
>>--- 159,170 ----
>>              doc.add(Field.Text("title", ""));
>>          }
>>+ */
>>+ 
>>+         doc.add(Field.Text("title", parser.getTitle()));
>>  
>>          //System.out.println("HTMLDocument.getLuceneDocument(): title field added: " + title);
>>  
>>!         // Add the tag-stripped contents as a Reader-valued Text field so it will get tokenized and indexed.
>>! /*
>>          String body = htmlDoc.getBody();
>>          String contents = "";
>>***************
>>*** 172,175 ****
>>--- 176,182 ----
>>  
>>          doc.add(Field.Text("contents", contents));
>>+ */
>>+ 
>>+         doc.add(Field.Text("contents", parser.getReader()));
>>  
>>          //System.out.println("HTMLDocument.getLuceneDocument(): contents field added: " + contents);
> 
>