gate.creole.nerc
Class EntityDescriptor

java.lang.Object
  |
  +--gate.creole.nerc.EntityDescriptor
All Implemented Interfaces:
Serializable

public class EntityDescriptor
extends Object
implements Serializable

Represents a single named entity

See Also:
Serialized Form

Field Summary
(package private)  String category
           
(package private)  int[] offsets
           
(package private)  String string
           
 
Constructor Summary
EntityDescriptor(Document document, Annotation annotation)
          Constructs a new entity descriptor starting from a Gate annotation
EntityDescriptor(String string, String category, int start, int end)
          Constructs a new entity descriptor
 
Method Summary
 String getCategory()
          Returns the category of the entity
 int[] getOffsets()
          Returns a pair of integers specifying the character offsets in the original file where the entity occured
 String getString()
          Returns a normalised string for the entity.
protected  String normaliseString(String text)
          Normalises a string.
 String toString()
          Returns a string giving the category, offsets and normalised string for the entity, with no newlines.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

string

String string

category

String category

offsets

int[] offsets
Constructor Detail

EntityDescriptor

public EntityDescriptor(String string,
                        String category,
                        int start,
                        int end)
Constructs a new entity descriptor

EntityDescriptor

public EntityDescriptor(Document document,
                        Annotation annotation)
Constructs a new entity descriptor starting from a Gate annotation
Method Detail

getString

public String getString()
Returns a normalised string for the entity. This is the string from the text document the entity was descovered in, with all whitespace sequences replaced by a single space character

getCategory

public String getCategory()
Returns the category of the entity

getOffsets

public int[] getOffsets()
Returns a pair of integers specifying the character offsets in the original file where the entity occured

toString

public String toString()
Returns a string giving the category, offsets and normalised string for the entity, with no newlines.
Overrides:
toString in class Object

normaliseString

protected String normaliseString(String text)
Normalises a string. That is removes all the leading and trailing whitespace characters and replaces all inner whitespace sequences with a single space character