notio
Class CoreferenceSet

java.lang.Object
  |
  +--notio.CoreferenceSet
All Implemented Interfaces:
java.io.Serializable

public class CoreferenceSet
extends java.lang.Object
implements java.io.Serializable

Class to implement coreference sets (also known as lines of identity). Note that it is necessary to add at least one valid dominant concept to this set before adding subordinate concepts that may belong to other coreference sets.

See Also:
Serialized Form

Constructor Summary
CoreferenceSet()
          Constructs a new, empty coreference set.
CoreferenceSet(java.lang.String newDefLabel)
          Constructs a new, empty coreference set with the specified defining label.
 
Method Summary
 void addCoreferentConcept(Concept newConcept)
          Adds a concept to this coreference set.
 Concept[] getCoreferentConcepts()
          Returns all of the concepts in this coreference set.
 Concept getDefiningConcept()
          Returns the defining concept associated with this coreference set or null if none was specified.
 java.lang.String getDefiningLabel()
          Returns the defining label associated with this coreference set or null if none was specified.
 Concept[] getDominantConcepts()
          Returns the dominant concepts in this coreference set.
 boolean getEnableScopeChecking()
          Returns the current value of the flag which enables or disables scope checking (disabled by default) when modifying this coreference set.
 Concept[] getSubordinateConcepts()
          Returns the subordinate concepts in this coreference set.
 boolean hasConcept(Concept concept)
          Tests whether the specified concept is a member of this coref set whether dominant or subordinate.
 boolean hasDominantConcept(Concept concept)
          Tests whether the specified concept is a dominant concept in this coreference set.
 boolean hasSubordinateConcept(Concept concept)
          Tests whether the specified concept is a subordinate concept of this coref set.
 void removeConcepts(Concept[] deadConcepts)
          Removes the specified concepts from this coreference set.
 void removeCoreferentConcept(Concept deadConcept)
          Removes the specified concept from this coreference set.
 void setDefiningConcept(Concept newDefConcept)
          Sets the defining concept associated with this coreference set.
 void setDefiningLabel(java.lang.String newDefLabel)
          Sets the defining label associated with this coreference set.
 void setEnableScopeChecking(boolean flag)
          Sets a flag which enables or disables scope checking (enabled by default) when modifying this coreference set.
 int size()
          Returns the number of concepts in this coreference set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoreferenceSet

public CoreferenceSet()
Constructs a new, empty coreference set.

CoreferenceSet

public CoreferenceSet(java.lang.String newDefLabel)
Constructs a new, empty coreference set with the specified defining label. The defining label is not an essential part of the coreference set and is not required (it can be null). It is included to make parsing and generating easier.
Parameters:
newDefLabel - the defining label for this coreference set.
Method Detail

setDefiningLabel

public void setDefiningLabel(java.lang.String newDefLabel)
Sets the defining label associated with this coreference set. No check is made to see if this label is in use by any other set so incautious use of this method may confuse translators. There is really little reason to change the coreference label of a set once established but the method is included for the sake of completeness.
Parameters:
newDefLabel - the defining label to be associated with this coreference set.

setDefiningConcept

public void setDefiningConcept(Concept newDefConcept)
                        throws InvalidDefiningConceptException
Sets the defining concept associated with this coreference set. This is the concept directly associated with the defining label. The primary use for this feature is related to parsing and generating, particulary as regards constructing arcs for relations. The specified concept must already be a dominant member of the coreference set.
Parameters:
newDefConcept - the defining concept to be associated with this coreference set.
Throws:
InvalidDefiningConceptException - if the specified concept is not a dominant concept in this set.

getDefiningLabel

public java.lang.String getDefiningLabel()
Returns the defining label associated with this coreference set or null if none was specified.
Returns:
the defining label associated with this coreference set.

getDefiningConcept

public Concept getDefiningConcept()
Returns the defining concept associated with this coreference set or null if none was specified.
Returns:
the defining concept associated with this coreference set.

size

public int size()
Returns the number of concepts in this coreference set.
Returns:
the number of concepts in this coreference set.

addCoreferentConcept

public void addCoreferentConcept(Concept newConcept)
                          throws CorefAddException
Adds a concept to this coreference set.
Parameters:
newConcept - the concept to be added to this coref set.
Throws:
CorefAddException - if the specified concept is dominant in another coreference set, or if the specified concept would be dominant in this set but is a member of other sets, or if the specified concept is not in the correct scope for this set, or if the specified concept is not enclosed by any graph.

removeCoreferentConcept

public void removeCoreferentConcept(Concept deadConcept)
                             throws CorefRemoveException
Removes the specified concept from this coreference set. Note that this method will automatically clear the current defining concept if it is removed from the set.
Parameters:
deadConcept - the concept to be removed from this coref set.
Throws:
CorefRemoveException - if removal of the specified concept would result in an invalid coreference set.

removeConcepts

public void removeConcepts(Concept[] deadConcepts)
                    throws CorefRemoveException
Removes the specified concepts from this coreference set. Note that this method will automatically clear the current defining concept if it is removed from the set.
Parameters:
deadConcepts - the array of concepts to be removed from this coref set.
Throws:
CorefRemoveException - if removal of the specified concepts would result in an invalid coreference set.

hasConcept

public boolean hasConcept(Concept concept)
Tests whether the specified concept is a member of this coref set whether dominant or subordinate.
Parameters:
concept - the concept being tested.
Returns:
true if the specified concept is a member of this coref set.

hasDominantConcept

public boolean hasDominantConcept(Concept concept)
Tests whether the specified concept is a dominant concept in this coreference set. Note that the return value of this method is undefined if scope checking is disabled.
Parameters:
concept - the concept being tested to see if it a dominant concept in this set.
Returns:
true if the specified concept is a dominant concept of this coreference set.

hasSubordinateConcept

public boolean hasSubordinateConcept(Concept concept)
Tests whether the specified concept is a subordinate concept of this coref set. Note that the return value of this method is undefined if scope checking is disabled.
Parameters:
concept - the concept being tested.
Returns:
true if the specified concept is a subordinate concept of this coref set.

getCoreferentConcepts

public Concept[] getCoreferentConcepts()
Returns all of the concepts in this coreference set.
Returns:
an array containing all the concepts in this coreference set.

getDominantConcepts

public Concept[] getDominantConcepts()
Returns the dominant concepts in this coreference set. Note that the return value of this method is undefined if scope checking is disabled.
Returns:
an array containing the dominant concepts in this coreference set.

getSubordinateConcepts

public Concept[] getSubordinateConcepts()
Returns the subordinate concepts in this coreference set. Note that this array may be empty. Note that the return value of this method is undefined if scope checking is disabled.
Returns:
an array containing the subordinate concepts in this coreference set, possibly empty.

setEnableScopeChecking

public void setEnableScopeChecking(boolean flag)
                            throws CorefAddException,
                                   InvalidDefiningConceptException
Sets a flag which enables or disables scope checking (enabled by default) when modifying this coreference set.
Parameters:
flag - the new setting for the scope checking flag.
Throws:
CorefAddException - if any of the concepts in the set have no enclosing graph, or if any of the concepts is out of scope, or if any of the domintant concepts belongs to one or more other coreference sets.
InvalidDefiningConceptException - if a defining concept has been specified and is not dominant.

getEnableScopeChecking

public boolean getEnableScopeChecking()
Returns the current value of the flag which enables or disables scope checking (disabled by default) when modifying this coreference set.
Returns:
the current setting for the scope checking flag.


Copyright 1998-2001 Finnegan Southey