Class DemoHTMLParser
java.lang.Object
org.apache.lucene.benchmark.byTask.feeds.DemoHTMLParser
- All Implemented Interfaces:
HTMLParser
Simple HTML Parser extracting title, meta tags, and body text that is based on NekoHTML.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe actual parser to read HTML documents -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParse the input Reader and return DocData.parse(DocData docData, String name, Date date, InputSource source, TrecContentSource trecSrc)
-
Constructor Details
-
DemoHTMLParser
public DemoHTMLParser()
-
-
Method Details
-
parse
public DocData parse(DocData docData, String name, Date date, Reader reader, TrecContentSource trecSrc) throws IOException Description copied from interface:HTMLParserParse the input Reader and return DocData. The provided name,title,date are used for the result, unless when they're null, in which case an attempt is made to set them from the parsed data.- Specified by:
parsein interfaceHTMLParser- Parameters:
docData- result reusedname- name of the result doc data.date- date of the result doc data. If null, attempt to set by parsed data.reader- reader of html text to parse.trecSrc- theTrecContentSourceused to parse dates.- Returns:
- Parsed doc data.
- Throws:
IOException- If there is a low-level I/O error.
-
parse
public DocData parse(DocData docData, String name, Date date, InputSource source, TrecContentSource trecSrc) throws IOException, SAXException - Throws:
IOExceptionSAXException
-