edu.mit.jmwe.data
Class MWEDescID

java.lang.Object
  extended by edu.mit.jmwe.data.MWEDescID
All Implemented Interfaces:
IHasForm, IHasMWEPOS, IMWEDescID, Comparable<IMWEDescID>

public class MWEDescID
extends Object
implements IMWEDescID

Default implementation of IMWEDescID.

Since:
jMWE 1.0.0
Version:
$Id: MWEDescID.java 620 2011-05-08 21:13:58Z markaf $
Author:
M.A. Finlayson

Field Summary
 
Fields inherited from interface edu.mit.jmwe.data.IMWEDescID
formPattern
 
Constructor Summary
MWEDescID(IMWEDescID rootID, String infForm)
          Constructs this description ID from the MWE's root ID and inflected form.
MWEDescID(String rootForm, MWEPOS pos)
          Constructs this description ID from the MWE's root (non inflected) form and part of speech.
 
Method Summary
 int compareTo(IMWEDescID id)
           
 boolean equals(Object obj)
           
 String getForm()
          Returns the object's surface form text, exactly as it appears in its original context, with capitalization intact.
 String getInflectedForm()
          Returns an inflected form of the MWE associated with this ID.
 MWEPOS getPOS()
          Returns the part of speech of this object.
 IMWEDescID getRootID()
          Returns the root ID of this decription ID.
 int hashCode()
           
 String toString()
           
static String toString(IMWEDescID id)
          Returns the String representation of the given id.
static void toString(IMWEDescID id, Appendable buf)
          Returns the String representation of the given id as: form_POS/infform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MWEDescID

public MWEDescID(String rootForm,
                 MWEPOS pos)
Constructs this description ID from the MWE's root (non inflected) form and part of speech. Sets the inflected form of this description to null.

Parameters:
rootForm - the non inflected form of the MWE associated with this id. Must be delimited by underscores.
pos - part of speech of the MWE associated with this id.
Since:
jMWE 1.0.0

MWEDescID

public MWEDescID(IMWEDescID rootID,
                 String infForm)
Constructs this description ID from the MWE's root ID and inflected form.

Parameters:
rootID - the root id of the MWE
infForm - inflected form of the MWE. Must be delimited by underscores.
Since:
jMWE 1.0.0
Method Detail

getRootID

public IMWEDescID getRootID()
Description copied from interface: IMWEDescID
Returns the root ID of this decription ID. The root ID contains the MWE's lemma and part of speech.

Specified by:
getRootID in interface IMWEDescID
Returns:
the root ID of this decription ID

getForm

public String getForm()
Description copied from interface: IHasForm
Returns the object's surface form text, exactly as it appears in its original context, with capitalization intact. May be a single word or punctuation. The surface form may not contain whitespace or underscores. This method will never return null.

Specified by:
getForm in interface IHasForm
Returns:
the original text, never null.

getInflectedForm

public String getInflectedForm()
Description copied from interface: IMWEDescID
Returns an inflected form of the MWE associated with this ID.

Specified by:
getInflectedForm in interface IMWEDescID
Returns:
the inflected form of this MWE.

getPOS

public MWEPOS getPOS()
Description copied from interface: IHasMWEPOS
Returns the part of speech of this object. May not return null.

Specified by:
getPOS in interface IHasMWEPOS
Returns:
the non-null part of speech of the MWE.

compareTo

public int compareTo(IMWEDescID id)
Specified by:
compareTo in interface Comparable<IMWEDescID>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

toString

public static String toString(IMWEDescID id)
Returns the String representation of the given id.

Parameters:
id - the id to be represented as a String.
Returns:
the String representation of the given id.
Since:
jMWE 1.0.0

toString

public static void toString(IMWEDescID id,
                            Appendable buf)
                     throws IOException
Returns the String representation of the given id as: form_POS/infform

Parameters:
id - the id to be represented as a String.
buf - the appendable buffer used to build the String
Throws:
IOException
Since:
jMWE 1.0.0


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.