de.dfki.lt.tools.tokenizer.output
Class XMLOutputter

java.lang.Object
  extended byde.dfki.lt.tools.tokenizer.output.XMLOutputter

public class XMLOutputter
extends java.lang.Object

XMLOutputter provides static methods that return an XML presentation of a AnnotatedString.

Version:
$Id: XMLOutputter.java,v 1.5 2005/04/12 08:47:38 steffen Exp $
Author:
Joerg Steffen, DFKI

Field Summary
static java.lang.String ID_ATT
          This is the name of the XML attribute in XML_TEXT_UNIT that contains the text unit id.
static java.lang.String IMAGE_ATT
          This is the name of the XML attribute in XML_TOKEN that contains the token image.
static java.lang.String LENGTH_ATT
          This is the name of the XML attribute in XML_TOKEN that contains the token length.
static java.lang.String OFFSET_ATT
          This is the name of the XML attribute in XML_TOKEN that contains the token offset.
static java.lang.String TOK_TYPE_ATT
          This is the name of the XML attribute in XML_TOKEN that contains the token type.
static java.lang.String XML_DOCUMENT
          This is the name of XML elements in the result that describe a document.
static java.lang.String XML_PARAGRAPH
          This is the name of XML elements in the result that describe a paragraph.
static java.lang.String XML_TEXT_UNIT
          This is the name of XML elements in the result that describe a text unit.
static java.lang.String XML_TOKEN
          This is the name of XML elements in the result that describe a token.
 
Constructor Summary
XMLOutputter()
           
 
Method Summary
static org.w3c.dom.Document createXMLDocument(AnnotatedString input, LanguageResource aLangRes)
          This creates an XML document from an annotated input.
static java.lang.String createXMLString(AnnotatedString input, LanguageResource aLangRes)
          This creates an XML string from an annotated input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_DOCUMENT

public static final java.lang.String XML_DOCUMENT
This is the name of XML elements in the result that describe a document.

See Also:
Constant Field Values

XML_PARAGRAPH

public static final java.lang.String XML_PARAGRAPH
This is the name of XML elements in the result that describe a paragraph.

See Also:
Constant Field Values

XML_TEXT_UNIT

public static final java.lang.String XML_TEXT_UNIT
This is the name of XML elements in the result that describe a text unit. Text units are contained in paragraphs.

See Also:
Constant Field Values

ID_ATT

public static final java.lang.String ID_ATT
This is the name of the XML attribute in XML_TEXT_UNIT that contains the text unit id.

See Also:
Constant Field Values

XML_TOKEN

public static final java.lang.String XML_TOKEN
This is the name of XML elements in the result that describe a token. Tokens are contained in text units.

See Also:
Constant Field Values

IMAGE_ATT

public static final java.lang.String IMAGE_ATT
This is the name of the XML attribute in XML_TOKEN that contains the token image.

See Also:
Constant Field Values

TOK_TYPE_ATT

public static final java.lang.String TOK_TYPE_ATT
This is the name of the XML attribute in XML_TOKEN that contains the token type.

See Also:
Constant Field Values

OFFSET_ATT

public static final java.lang.String OFFSET_ATT
This is the name of the XML attribute in XML_TOKEN that contains the token offset.

See Also:
Constant Field Values

LENGTH_ATT

public static final java.lang.String LENGTH_ATT
This is the name of the XML attribute in XML_TOKEN that contains the token length.

See Also:
Constant Field Values
Constructor Detail

XMLOutputter

public XMLOutputter()
Method Detail

createXMLDocument

public static org.w3c.dom.Document createXMLDocument(AnnotatedString input,
                                                     LanguageResource aLangRes)
This creates an XML document from an annotated input.

Parameters:
input - an AnnotatedString
aLangRes - a {link de.dfki.lt.tools.tokenizer.LanguageResource}; needed for the tags for XML annotation
Returns:
a Document
Throws:
ProcessingException - if an error occurs

createXMLString

public static java.lang.String createXMLString(AnnotatedString input,
                                               LanguageResource aLangRes)
This creates an XML string from an annotated input. Correctly works with Unicode (uschaefer 2006-06-09).

Parameters:
input - an AnnotatedString
aLangRes - a {link de.dfki.lt.tools.tokenizer.LanguageResource}; needed for the tags for XML annotation
Returns:
an XML String
Throws:
ProcessingException - if an error occurs