uk.ac.essex.malexa.nlp.dp.GuiTAR
Class NominalGroup

java.lang.Object
  extended byuk.ac.essex.malexa.nlp.dp.GuiTAR.Cf
      extended byuk.ac.essex.malexa.nlp.dp.GuiTAR.NominalGroup
All Implemented Interfaces:
AnaphoraResolution
Direct Known Subclasses:
DefiniteDescription, Demonstrative, PersonalPronoun

public class NominalGroup
extends Cf

A class that encapsulates the general functionality of a Noun Phrase (NP).

Version:
1.1
Author:
Mijail A. Kabadjov

Field Summary
static byte A_NP
           
private  Agreement agreement
           
static byte ANOTHER_NP
           
private  int[] antecedentIndicators
           
static byte BARE_NP
           
static byte COORD_NP
           
static byte[] DEFINITE
           
static byte DIRECT_OBJECT
           
private  byte gramaticalFunction
           
private  Node headNode
           
static byte[] INDEFINITE
           
static byte INDIRECT_OBJECT
           
static byte MEAS_NP
           
static byte NUM_NP
           
static byte PERS_PRO
           
static byte PN
           
static byte POSS_NP
           
static byte POSS_PRO
           
private  Vector postModifiers
           
private  Vector preModifiers
           
static byte[] PRONOUNS
           
static byte Q_NP
           
static byte Q_PRO
           
static byte SUBJECT
           
static byte SUCH_NP
           
static byte THAT_NP
           
static byte THAT_PRO
           
static byte THE_NP
           
static byte THE_PN
           
static byte THIS_NP
           
static byte THIS_PRO
           
static byte WH_PRO
           
 
Fields inherited from class uk.ac.essex.malexa.nlp.dp.GuiTAR.Cf
 
Constructor Summary
NominalGroup(Node theNode, Utterance theUtterance, byte type)
          Constructor.
 
Method Summary
static byte findType(Node node)
          A static method that reads the type of a Noun Phrase from the source XML file.
 Agreement getAgreement()
          Returns the agreement (syntactic) features of this NP (namely person, number, gender).
 int[] getAntecedentIndicators()
          Returns the antecedent indicators of this NP (used in Mitkov's algorithm for pronoun resolution).
static byte getByteType(String npType)
          Converts an NP type encoded in a String format into a byte representation.
 Node getHeadNode()
          Returns the node holding the head of the NP.
 Vector getPostModifiers()
          Returns the vector of post-modifiers.
 Vector getPreModifiers()
          Returns the vector of pre-modifiers.
static String getStringType(byte type)
          Converts an NP type encoded in a byte format into a string representation.
static NominalGroup newInstance(Node theNode, Utterance theUtterance)
          A static method that creates an appropriate object (implementation) for a given noun phrase, depending on its type.
 Cf resolveAnaphor(DiscourseModel dm)
          A dummy method.
private  void setAgreeementFeatures()
          Reads the agreement features (number, person, gender) from input file and stores them internally.
 void setAntecedentIndicators(int[] indicators)
          Sets the antecedent indicators of this NP.
private  void setGramaticalFunction()
          Reads the gramatical function from input file and stores it internally.
private  void setHeadNode()
          Reads the head of this NP from input file and stores it internally.
private  void setModifiers()
          Reads the modifiers (pre- and post-) from input file and stores them internally.
 
Methods inherited from class uk.ac.essex.malexa.nlp.dp.GuiTAR.Cf
findCfById, getNode, getType, getUtterance, isAnaphoric, setAnaphoric, setNode, setType, setUtterance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_NP

public static final byte THE_NP
See Also:
Constant Field Values

THAT_NP

public static final byte THAT_NP
See Also:
Constant Field Values

THIS_NP

public static final byte THIS_NP
See Also:
Constant Field Values

SUCH_NP

public static final byte SUCH_NP
See Also:
Constant Field Values

A_NP

public static final byte A_NP
See Also:
Constant Field Values

ANOTHER_NP

public static final byte ANOTHER_NP
See Also:
Constant Field Values

NUM_NP

public static final byte NUM_NP
See Also:
Constant Field Values

MEAS_NP

public static final byte MEAS_NP
See Also:
Constant Field Values

BARE_NP

public static final byte BARE_NP
See Also:
Constant Field Values

POSS_NP

public static final byte POSS_NP
See Also:
Constant Field Values

Q_NP

public static final byte Q_NP
See Also:
Constant Field Values

PN

public static final byte PN
See Also:
Constant Field Values

THE_PN

public static final byte THE_PN
See Also:
Constant Field Values

COORD_NP

public static final byte COORD_NP
See Also:
Constant Field Values

POSS_PRO

public static final byte POSS_PRO
See Also:
Constant Field Values

PERS_PRO

public static final byte PERS_PRO
See Also:
Constant Field Values

WH_PRO

public static final byte WH_PRO
See Also:
Constant Field Values

THIS_PRO

public static final byte THIS_PRO
See Also:
Constant Field Values

THAT_PRO

public static final byte THAT_PRO
See Also:
Constant Field Values

Q_PRO

public static final byte Q_PRO
See Also:
Constant Field Values

DEFINITE

public static final byte[] DEFINITE

INDEFINITE

public static final byte[] INDEFINITE

PRONOUNS

public static final byte[] PRONOUNS

SUBJECT

public static final byte SUBJECT
See Also:
Constant Field Values

DIRECT_OBJECT

public static final byte DIRECT_OBJECT
See Also:
Constant Field Values

INDIRECT_OBJECT

public static final byte INDIRECT_OBJECT
See Also:
Constant Field Values

headNode

private Node headNode

gramaticalFunction

private byte gramaticalFunction

preModifiers

private Vector preModifiers

postModifiers

private Vector postModifiers

agreement

private Agreement agreement

antecedentIndicators

private int[] antecedentIndicators
Constructor Detail

NominalGroup

public NominalGroup(Node theNode,
                    Utterance theUtterance,
                    byte type)
Constructor. Sets the DOM node that holds the head of the NP (typically a word element - 'W'), the premodifiers, postmodifiers, agreement features and the gramatical function (i.e. subject).

Parameters:
theNode - The node that holds the Cf
theUtterance - The Utterance of this Cf
type - The type of the NP
Method Detail

resolveAnaphor

public Cf resolveAnaphor(DiscourseModel dm)
A dummy method. No implementation at this level for the moment.

Parameters:
dm - The ongoing DiscourseModel to be searched for potential antecedents
Returns:
Cf The proposed antecedent, null if no match

getHeadNode

public Node getHeadNode()
Returns the node holding the head of the NP.

Returns:
Node the node holding the head of the NP

getPreModifiers

public Vector getPreModifiers()
Returns the vector of pre-modifiers.

Returns:
Vector The vector of pre-modifiers

getPostModifiers

public Vector getPostModifiers()
Returns the vector of post-modifiers.

Returns:
Vector The vector of post-modifiers

getAgreement

public Agreement getAgreement()
Returns the agreement (syntactic) features of this NP (namely person, number, gender).

Returns:
Agreement the agreement features

getAntecedentIndicators

public int[] getAntecedentIndicators()
Returns the antecedent indicators of this NP (used in Mitkov's algorithm for pronoun resolution).

Returns:
int[] The antecedent indicators

setAntecedentIndicators

public void setAntecedentIndicators(int[] indicators)
Sets the antecedent indicators of this NP.


setHeadNode

private void setHeadNode()
Reads the head of this NP from input file and stores it internally. The input file is expected to be MAS-XML compliant.


setGramaticalFunction

private void setGramaticalFunction()
Reads the gramatical function from input file and stores it internally. The input file is expected to be MAS-XML compliant. Note: At the moment MAS-XML does not include GF.


setAgreeementFeatures

private void setAgreeementFeatures()
Reads the agreement features (number, person, gender) from input file and stores them internally. The input file is expected to be MAS-XML compliant.


setModifiers

private void setModifiers()
Reads the modifiers (pre- and post-) from input file and stores them internally. The input file is expected to be MAS-XML compliant.


newInstance

public static NominalGroup newInstance(Node theNode,
                                       Utterance theUtterance)
A static method that creates an appropriate object (implementation) for a given noun phrase, depending on its type.

Parameters:
theNode - The DOM node that holds the noun phrase to be instantiated
theUtterance - The Utterance of the noun phrase to be instantiated
Returns:
NominalGroup The reference to the newly created object

findType

public static byte findType(Node node)
A static method that reads the type of a Noun Phrase from the source XML file.

Parameters:
node - The DOM node that holds the noun phrase to be processesed
Returns:
byte The type of the noun phrase (the-np, a-np, etc.)

getStringType

public static String getStringType(byte type)
Converts an NP type encoded in a byte format into a string representation. Eg. 0 -> "the-np".

Parameters:
type - The type as a byte
Returns:
String The type as a String

getByteType

public static byte getByteType(String npType)
Converts an NP type encoded in a String format into a byte representation. Eg. "the-np" -> 0.

Parameters:
npType - The type as String
Returns:
byte The type as byte