info.ephyra.answerselection.definitional
Class Dossier

java.lang.Object
  extended by info.ephyra.answerselection.definitional.Dossier

public class Dossier
extends java.lang.Object

A Dossier specifies different properties of a target (such as a person or an event). These properties depend on the target type. For instance, a person has a property 'nationality', whereas an event has a property 'date'.

Version:
2008-02-10
Author:
Guido Sautter

Field Summary
static java.lang.String ENTERTAINMENT
           
private static java.lang.String[] ENTERTAINMENT_PROPERTIES
           
static java.lang.String EVENT
           
private static java.lang.String[] EVENT_PROPERTIES
           
static java.lang.String ORGANIZATION
           
private static java.lang.String[] ORGANIZATION_PROPERTIES
           
static java.lang.String PERSON
           
private static java.lang.String[] PERSON_PROPERTIES
           
private  java.util.Properties properties
           
private  java.lang.String[] propertyNames
           
protected  java.lang.String target
           
protected  java.lang.String targetType
           
private static java.util.HashMap<java.lang.String,java.lang.String[]> targetTypeProperties
           
private static java.util.ArrayList<java.lang.String> targetTypes
           
static java.lang.String THING
           
private static java.lang.String[] THING_PROPERTIES
           
 
Constructor Summary
Dossier(java.lang.String target, java.lang.String targetType)
           
 
Method Summary
static void addTargetType(java.lang.String targetType, java.lang.String[] properties)
          register an additional type of target (hard coded are PERSON, ORGANIZATION, EVENT, ENTERTAINMENT and THING)
static void addTargetTypeProperty(java.lang.String targetType, java.lang.String property)
          add a property to some existing target type
static Dossier getDossier(java.lang.String target, java.lang.String targetType, java.lang.String[] givenProperties, java.lang.String[] givenValues)
          produce a dossier
 java.lang.String[] getMissingPropertyNames()
           
protected static java.lang.String[] getPropertiesForTargetType(java.lang.String targetType)
          retrieve the names of the properties interesting for some given type of target
 java.lang.String getProperty(java.lang.String property)
          retrieve the value of a property
 java.lang.String[] getPropertyNames()
           
 java.lang.String getTarget()
           
 java.lang.String getTargetType()
           
static java.lang.String getTargetType(java.lang.String[] givenProperties)
          determine the type of a target, using properties as evidence
 boolean isPropertySet(java.lang.String property)
          check if this dossier already contains a value for some property
 void setProperty(java.lang.String property, java.lang.String value)
          set a property of the target to a given value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected java.lang.String target

targetType

protected java.lang.String targetType

propertyNames

private java.lang.String[] propertyNames

properties

private java.util.Properties properties

targetTypes

private static java.util.ArrayList<java.lang.String> targetTypes

targetTypeProperties

private static java.util.HashMap<java.lang.String,java.lang.String[]> targetTypeProperties

PERSON

public static final java.lang.String PERSON
See Also:
Constant Field Values

ORGANIZATION

public static final java.lang.String ORGANIZATION
See Also:
Constant Field Values

EVENT

public static final java.lang.String EVENT
See Also:
Constant Field Values

THING

public static final java.lang.String THING
See Also:
Constant Field Values

ENTERTAINMENT

public static final java.lang.String ENTERTAINMENT
See Also:
Constant Field Values

PERSON_PROPERTIES

private static final java.lang.String[] PERSON_PROPERTIES

ORGANIZATION_PROPERTIES

private static final java.lang.String[] ORGANIZATION_PROPERTIES

EVENT_PROPERTIES

private static final java.lang.String[] EVENT_PROPERTIES

THING_PROPERTIES

private static final java.lang.String[] THING_PROPERTIES

ENTERTAINMENT_PROPERTIES

private static final java.lang.String[] ENTERTAINMENT_PROPERTIES
Constructor Detail

Dossier

public Dossier(java.lang.String target,
               java.lang.String targetType)
Parameters:
target - the target String
targetType - the type of the target
Method Detail

getTarget

public java.lang.String getTarget()
Returns:
the target.

getTargetType

public java.lang.String getTargetType()
Returns:
the targetType.

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)
set a property of the target to a given value

Parameters:
property - the name of the property
value - the value of the property

getProperty

public java.lang.String getProperty(java.lang.String property)
retrieve the value of a property

Parameters:
property - the name of the property
Returns:
the value associated with the specified property, or null, if there is no such value

isPropertySet

public boolean isPropertySet(java.lang.String property)
check if this dossier already contains a value for some property

Parameters:
property - the name of the property to check
Returns:
true iff this dossier has a value associated with the specified property

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns:
the names of the properties contained in this dossier (regardless if they already have a value associated with them or not)

getMissingPropertyNames

public java.lang.String[] getMissingPropertyNames()
Returns:
the names of the properties in this dossier that do not yet have a value associated with them

getPropertiesForTargetType

protected static java.lang.String[] getPropertiesForTargetType(java.lang.String targetType)
retrieve the names of the properties interesting for some given type of target

Parameters:
targetType - the target type
Returns:
an array containing the names of the properties interesting for a target of the specified type

getTargetType

public static java.lang.String getTargetType(java.lang.String[] givenProperties)
determine the type of a target, using properties as evidence

Parameters:
givenProperties - the names of the properties already known
Returns:
the type of target that is most likely to ahe the specified properties

getDossier

public static Dossier getDossier(java.lang.String target,
                                 java.lang.String targetType,
                                 java.lang.String[] givenProperties,
                                 java.lang.String[] givenValues)
produce a dossier

Parameters:
target - the target string
targetType - the target type (if set to null, the target type will be determined automatically from the given properties)
givenProperties - the properties of the target that are properties already known
givenValues - the values associated with the known properties
Returns:
dossier

addTargetType

public static void addTargetType(java.lang.String targetType,
                                 java.lang.String[] properties)
register an additional type of target (hard coded are PERSON, ORGANIZATION, EVENT, ENTERTAINMENT and THING)

Parameters:
targetType - the name for the new target type
properties - the properties that are of interes with regard to the new target type

addTargetTypeProperty

public static void addTargetTypeProperty(java.lang.String targetType,
                                         java.lang.String property)
add a property to some existing target type

Parameters:
targetType - the target type
property - the new property to be associated with the specified target type