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

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

public class AnnotatedText
extends Object

A text with a list of annotation layers.

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

Field Summary
 List<AnnotationLayer> layers
           
 String[] lemmas
           
 String[] poss
           
 HashMap<String,Object> properties
           
 String text
           
 String[] tokens
           
 
Constructor Summary
AnnotatedText()
          Creates a new AnnotatedText.
 
Method Summary
 Object getProperty(String name)
          Gets a property of the annotated text.
 void setProperty(String name, Object value)
          Sets a property of the annotated text.
 String toColoredHTML()
          Returns an HTML representation of the layers, which can be used to present the text in a JEditorPane.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

text

public String text

properties

public HashMap<String,Object> properties

layers

public List<AnnotationLayer> layers

tokens

public String[] tokens

poss

public String[] poss

lemmas

public String[] lemmas
Constructor Detail

AnnotatedText

public AnnotatedText()
Creates a new AnnotatedText.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

toColoredHTML

public String toColoredHTML()
Returns an HTML representation of the layers, which can be used to present the text in a JEditorPane.

Returns:
the HTML text.

getProperty

public Object getProperty(String name)
Gets a property of the annotated text.

Parameters:
name - the name of the property to check.
Returns:
the property, or null if not found.

setProperty

public void setProperty(String name,
                        Object value)
Sets a property of the annotated text.

Parameters:
name - the name of the property to set.
value - the new value of the property.