modnlp.tc.parser
public class XMLHandler extends org.xml.sax.helpers.DefaultHandler
NewsParser
Constructor and Description |
---|
XMLHandler(java.lang.String fn)
Set up parser
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Callback for PCDATA events.
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name)
Callback method activated when an XML end element 'event' occurs
|
void |
error(org.xml.sax.SAXParseException exception)
Report all recoverable errors, and try to continue parsing.
|
void |
fatalError(org.xml.sax.SAXParseException exception)
Report all fatal errors, and try to continue parsing.
|
ParsedCorpus |
getParsedCorpus()
Implement the Parser interface
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Print a message for ignorable whitespace.
|
void |
parse()
parseNews: Set up parser object, perform parsing
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes atts)
Callback method activated when an XML start element 'event' occurs
|
void |
warning(org.xml.sax.SAXParseException exception)
Report all warnings, and continue parsing.
|
public void parse()
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
HandlerBase
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
HandlerBase
public void characters(char[] ch, int start, int length)
BODY
tags.characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch[]
- array containing XML PCDATA (text)start
- where the text startslength
- where it endsHandlerBase
public void ignorableWhitespace(char[] ch, int start, int length)
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
DocumentHandler.ignorableWhitespace(char[], int, int)
public void warning(org.xml.sax.SAXParseException exception)
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
ErrorHandler.warning(org.xml.sax.SAXParseException)
public void error(org.xml.sax.SAXParseException exception)
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
ErrorHandler.error(org.xml.sax.SAXParseException)
public void fatalError(org.xml.sax.SAXParseException exception)
Note: results are no longer reliable once a fatal error has been reported.
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
ErrorHandler.fatalError(org.xml.sax.SAXParseException)
public ParsedCorpus getParsedCorpus()