se.lth.cs.nlp.nlputils.annotations
Class RawXMLAnnotation

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.annotations.AnnotationType
      extended by se.lth.cs.nlp.nlputils.annotations.RawXMLAnnotation

public class RawXMLAnnotation
extends AnnotationType

This AnnotationType implements functionality to handle classical nested XML annotations.

Author:
Richard Johansson (richard@cs.lth.se)

Method Summary
 AnnotatedText createLayers(InputStream in)
          Creates an annotated text with a single layer.
 AnnotatedText createLayers(String s)
          This method is unimplemented since raw XML text should never be put into Java strings (because this may break the encoding).
static RawXMLAnnotation instance()
          Returns the instance of this AnnotationType.
 void printLayers(OutputStream out, String text, List<AnnotationLayer> l)
          Prints a list of annotation layers on a text to an output stream.
 
Methods inherited from class se.lth.cs.nlp.nlputils.annotations.AnnotationType
printLayers, printLayers, printLayers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static RawXMLAnnotation instance()
Returns the instance of this AnnotationType.

Returns:
the instance of this AnnotationType.

createLayers

public AnnotatedText createLayers(InputStream in)
                           throws IOException
Creates an annotated text with a single layer.

Overrides:
createLayers in class AnnotationType
Parameters:
in - the input stream from which the annotation is read.
Returns:
the resulting AnnotatedText.
Throws:
IOException

createLayers

public AnnotatedText createLayers(String s)
                           throws IOException
This method is unimplemented since raw XML text should never be put into Java strings (because this may break the encoding).

Overrides:
createLayers in class AnnotationType
Parameters:
s - the string.
Returns:
the AnnotatedText.
Throws:
IOException

printLayers

public void printLayers(OutputStream out,
                        String text,
                        List<AnnotationLayer> l)
                 throws IOException
Prints a list of annotation layers on a text to an output stream. The spans in the layers must be nestable.

Overrides:
printLayers in class AnnotationType
Parameters:
out - the output stream.
text - the text.
l - the list of annotation layers.
Throws:
IOException