modnlp.util
public class XMLSplitter extends org.xml.sax.helpers.DefaultHandler
include
to the
split_element. For instance, add the following after the speech element:
Next you will need to create speech.dtd by copying the speech
element specification from the original dtd.NewsParser
Constructor and Description |
---|
XMLSplitter(java.lang.String fn,
java.lang.String ie,
java.lang.String dtd,
java.lang.String enc)
Set up parser
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Callback for PCDATA events.
|
void |
comment(char[] ch,
int start,
int length) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
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 |
endEntity(java.lang.String name) |
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.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Print a message for ignorable whitespace.
|
static void |
main(java.lang.String[] args) |
void |
notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId) |
void |
parse() |
void |
processingInstruction(java.lang.String target,
java.lang.String data) |
void |
skippedEntity(java.lang.String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId) |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes attl)
Callback method activated when an XML start element 'event' occurs
|
void |
startEntity(java.lang.String name) |
void |
unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName) |
void |
warning(org.xml.sax.SAXParseException exception)
Report all warnings, and continue parsing.
|
public XMLSplitter(java.lang.String fn, java.lang.String ie, java.lang.String dtd, java.lang.String enc) throws java.lang.Exception
java.lang.Exception
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attl)
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 endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
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 void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
processingInstruction
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
skippedEntity
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
notationDecl
in interface org.xml.sax.DTDHandler
notationDecl
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName) throws org.xml.sax.SAXException
unparsedEntityDecl
in interface org.xml.sax.DTDHandler
unparsedEntityDecl
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endDTD() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void parse()
public static void main(java.lang.String[] args)