public class StandardsExtractingContentHandler extends ContentHandlerDecorator
| Modifier and Type | Field and Description |
|---|---|
private Metadata |
metadata |
static java.lang.String |
STANDARD_REFERENCES |
private java.lang.StringBuilder |
stringBuilder |
private double |
threshold |
| Modifier | Constructor and Description |
|---|---|
protected |
StandardsExtractingContentHandler()
Creates a decorator that by default forwards incoming SAX events to a
dummy content handler that simply ignores all the events.
|
|
StandardsExtractingContentHandler(org.xml.sax.ContentHandler handler,
Metadata metadata)
Creates a decorator for the given SAX event handler and Metadata object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
The characters method is called whenever a Parser wants to pass raw
characters to the ContentHandler.
|
void |
endDocument()
This method is called whenever the Parser is done parsing the file.
|
double |
getThreshold()
Gets the threshold to be used for selecting the standard references found
within the text based on their score.
|
void |
setThreshold(double score)
Sets the score to be used as threshold.
|
endElement, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, toStringpublic static final java.lang.String STANDARD_REFERENCES
private Metadata metadata
private java.lang.StringBuilder stringBuilder
private double threshold
public StandardsExtractingContentHandler(org.xml.sax.ContentHandler handler,
Metadata metadata)
handler - SAX event handler to be decorated.metadata - Metadata object.protected StandardsExtractingContentHandler()
ContentHandlerDecorator.setContentHandler(ContentHandler) method to
switch to a more usable underlying content handler. Also creates a dummy
Metadata object to store phone numbers in.public double getThreshold()
public void setThreshold(double score)
score - the score to be used as threshold.public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class ContentHandlerDecoratororg.xml.sax.SAXExceptionpublic void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class ContentHandlerDecoratororg.xml.sax.SAXException