pt.tumba.cage
Class NamedEntity

java.lang.Object
  extended by pt.tumba.cage.NamedEntity

public class NamedEntity
extends java.lang.Object

A Named Entity recognized in the text.

Author:
Bruno Martins

Constructor Summary
NamedEntity()
          Constructor for an uninitialized NamedEntity.
NamedEntity(java.lang.String qualifyer, java.lang.String match, java.lang.String tag, java.lang.String type)
          Constructor for NamedEntity.
NamedEntity(java.lang.String qualifyer, java.lang.String match, java.lang.String tag, java.lang.String type, int flags)
          Constructor for NamedEntity.
 
Method Summary
static boolean equalTypes(java.lang.String type1, java.lang.String type2)
          Checks if two given strings with type information contain exactly the same types.
 int getHTMLFlags()
          Returns the flags for the HTML markup contexts where the entity was found.
 java.lang.String getMatch()
          Returns the part of the named entity that matched the lexicon.
 java.lang.String getNamedEntity()
          Returns a String with the named entity.
 java.lang.String getQualifyer()
          Returns the qualifyer for the named entity.
 java.lang.String[] getSubType()
          Returns the subtypes associated with the named entity.
 java.lang.String getTag()
          Returns the main cathegory associated with the named entity (i.e.
 java.lang.String[] getType()
          Returns the main types associated with the named entity.
static boolean isMoreSpecific(java.lang.String type1, java.lang.String type2)
          Checks if one string contains more specific type information than another.
 boolean isSubType(java.lang.String st)
          Checks is this named entity belongs to a given subtype.
 boolean isType(java.lang.String t)
          Checks is this named entity belongs to a given type.
static java.lang.String[] parseType(java.lang.String type)
          Parses a String with type information into an array of Strings with all the types.
 void setHTMLFlags(int flags)
          Sets the flags for the HTML markup contexts where the entity was found.
 java.lang.String setMatch(java.lang.String match)
          Sets the part of the named entity that matched the lexicon.
 java.lang.String setNamedEntity(java.lang.String namedEntity, java.lang.String qualifyer)
          Sets the named entity.
 java.lang.String setQualifyer(java.lang.String qualifyer)
          Sets the qualifyer for this named entity.
 void setSubType(java.lang.String[] subType)
          Sets the subtypes associated with the named entity.
 void setTag(java.lang.String tag)
          Sets the main cathegory associated with the named entity (i.e.
 void setType(java.lang.String[] type)
          Sets the main types associated with the named entity.
static boolean shareOneType(java.lang.String type1, java.lang.String type2)
          Checks if two strings with type information contain at least one type in common.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedEntity

public NamedEntity()
Constructor for an uninitialized NamedEntity.


NamedEntity

public NamedEntity(java.lang.String qualifyer,
                   java.lang.String match,
                   java.lang.String tag,
                   java.lang.String type)
Constructor for NamedEntity.

Parameters:
qualifyer - The qualifyer for the named entity.
match - The part of the named entity that matched the lexicon.
tag - The main cathegory associated with the named entity.
type - The types and subtypes associated with the named entity.

NamedEntity

public NamedEntity(java.lang.String qualifyer,
                   java.lang.String match,
                   java.lang.String tag,
                   java.lang.String type,
                   int flags)
Constructor for NamedEntity.

Parameters:
qualifyer - The qualifyer for the named entity.
match - The part of the named entity that matched the lexicon.
tag - The main cathegory associated with the named entity.
type - The types and subtypes associated with the named entity.
flags - Flags for the HTML markup contexts where the entity was found.
Method Detail

getNamedEntity

public java.lang.String getNamedEntity()
Returns a String with the named entity.

Returns:
A String with the named entity.

getMatch

public java.lang.String getMatch()
Returns the part of the named entity that matched the lexicon.

Returns:
The part of the named entity that matched the lexicon.

getQualifyer

public java.lang.String getQualifyer()
Returns the qualifyer for the named entity.

Returns:
The qualifyer for the named entity.

getTag

public java.lang.String getTag()
Returns the main cathegory associated with the named entity (i.e. name,organization,place or misc).

Returns:
The main cathegory associated with the named entity (i.e. name,organization,place or misc).

getType

public java.lang.String[] getType()
Returns the main types associated with the named entity.

Returns:
The main types associated with the named entity.

getSubType

public java.lang.String[] getSubType()
Returns the subtypes associated with the named entity.

Returns:
The subtypes associated with the named entity.

getHTMLFlags

public int getHTMLFlags()
Returns the flags for the HTML markup contexts where the entity was found.

Returns:
The flags for the HTML markup contexts where the entity was found.

setHTMLFlags

public void setHTMLFlags(int flags)
Sets the flags for the HTML markup contexts where the entity was found.

Parameters:
flags - The flags for the HTML markup contexts where the entity was found.

isType

public boolean isType(java.lang.String t)
Checks is this named entity belongs to a given type.

Parameters:
t - The type to check.
Returns:
true if this named entity belongs to the given type and false otherwise.

isSubType

public boolean isSubType(java.lang.String st)
Checks is this named entity belongs to a given subtype.

Parameters:
st - The subtype to check.
Returns:
true if this named entity belongs to the given subtype and false otherwise.

setNamedEntity

public java.lang.String setNamedEntity(java.lang.String namedEntity,
                                       java.lang.String qualifyer)
Sets the named entity.

Parameters:
namedEntity - The named entity recognized in the text.
qualifyer - The qualifyer for this named entity.
Returns:
A String with the named entity.

setMatch

public java.lang.String setMatch(java.lang.String match)
Sets the part of the named entity that matched the lexicon.

Parameters:
match - The part of the named entity that matched the lexicon.
Returns:
A String with the named entity.

setQualifyer

public java.lang.String setQualifyer(java.lang.String qualifyer)
Sets the qualifyer for this named entity.

Parameters:
qualifyer - The qualifyer for this named entity.
Returns:
A String with the named entity.

setTag

public void setTag(java.lang.String tag)
Sets the main cathegory associated with the named entity (i.e. name,organization,place or misc).

Parameters:
tag - The main cathegory associated with the named entity (i.e. name,organization,place or misc).

setType

public void setType(java.lang.String[] type)
Sets the main types associated with the named entity.

Parameters:
type - The main types associated with the named entity.

setSubType

public void setSubType(java.lang.String[] subType)
Sets the subtypes associated with the named entity.

Parameters:
subType - The subtypes associated with the named entity.

parseType

public static java.lang.String[] parseType(java.lang.String type)
Parses a String with type information into an array of Strings with all the types.

Parameters:
type - A String with type information.
Returns:
An array of strings with all the types in the given string.

equalTypes

public static boolean equalTypes(java.lang.String type1,
                                 java.lang.String type2)
Checks if two given strings with type information contain exactly the same types.

Parameters:
type1 - A string with type information.
type2 - Another string with type information.
Returns:
true if both Strings contain exactly the same types and false otherwise.

isMoreSpecific

public static boolean isMoreSpecific(java.lang.String type1,
                                     java.lang.String type2)
Checks if one string contains more specific type information than another.

Parameters:
type1 - A string with type information.
type2 - Another string with type information.
Returns:
true if the first string contains more specific type information and false otherwise.

shareOneType

public static boolean shareOneType(java.lang.String type1,
                                   java.lang.String type2)
Checks if two strings with type information contain at least one type in common.

Parameters:
type1 - A string with type information.
type2 - Another string with type information.
Returns:
true if the two strings contain one type in common and false otherwise.