org.eml.MMAX2.api
Interface DiscourseAPI

All Known Implementing Classes:
MMAX2Discourse

public interface DiscourseAPI

This interface defines public methods for accessing MMAX2Discourse objects.


Method Summary
 MMAX2Discourse _buildDiscourse(java.lang.String inFileName, java.lang.String commonPathsFileName)
          (API) Loads the .mmax file of name inFileName, using the common_paths.xml file specified in commonPathsFileName.
 MMAX2DiscourseElement getDiscourseElementAtDiscoursePosition(int discoursePosition)
          (API) Returns the MMAX2DiscourseElement object (i.e.
 MMAX2DiscourseElement getDiscourseElementByID(java.lang.String discourseElementID)
          (API) Returns the MMAX2DiscourseElement object (i.e.
 int getDiscourseElementCount()
          (API) Returns the number of MMAX2DiscourseElement objects in this discourse.
 MMAX2DiscourseElement[] getDiscourseElements()
          (API) Returns an array containing all MMAX2DiscourseElement objects in the current discourse, ordered in discourse order.
 MMAX2DiscourseElement[] getDiscourseElements(Markable markable)
          (API) Returns an array containing all MMAX2DiscourseElement objects in Markable markable, ordered in discourse order.
 MarkableLevel getMarkableLevelByName(java.lang.String levelName, boolean interactive)
          (API) Returns the MarkableLevel object of name levelName, or null if no MarkableLevel of this name exists.
 MMAX2DiscourseElement getNextDiscourseElement(MMAX2DiscourseElement currentElement)
          (API) Returns the MMAX2DiscourseElement object at discourse position currentElement.DiscourseElementAPI.getDiscoursePosition()+1, or null if none exists at this position.
 MMAX2DiscourseElement getPreviousDiscourseElement(MMAX2DiscourseElement currentElement)
          (API) Returns the MMAX2DiscourseElement object at discourse position currentElement.DiscourseElementAPI.getDiscoursePosition()-1, or null if none exists at this position.
 

Method Detail

getMarkableLevelByName

MarkableLevel getMarkableLevelByName(java.lang.String levelName,
                                     boolean interactive)
(API) Returns the MarkableLevel object of name levelName, or null if no MarkableLevel of this name exists.

Parameters:
levelName - The name of the MarkableLevel to return.
interactive - If true, a message box will be displayed if no MarkableLevel of name levelName could be found.
Returns:
The MarkableLevel object of name levelName, or null.

_buildDiscourse

MMAX2Discourse _buildDiscourse(java.lang.String inFileName,
                               java.lang.String commonPathsFileName)
(API) Loads the .mmax file of name inFileName, using the common_paths.xml file specified in commonPathsFileName.
Note: This is a dummy implementation only. The actual method to use is the *static* method

public static MMAX2Discourse buildDiscourse(String inFileName, String commonPathsFileName);

Parameters:
inFileName - The name and path of the .mmax file to load.
commonPathsFileName - The name (and possibly path) of the common_paths.xml file to use. If this parameter is an empty string, the file common_paths.xml in the current directory will be used.
Returns:
The MMAX2Discourse object containing the loaded .mmax file.

getDiscourseElementAtDiscoursePosition

MMAX2DiscourseElement getDiscourseElementAtDiscoursePosition(int discoursePosition)
(API) Returns the MMAX2DiscourseElement object (i.e. base data element) associated with discourse position discoursePosition, or null if none exists at this position.

Parameters:
discoursePosition - The numeric discourse position of the MMAX2DiscourseElement to return. This is normally the base data element's position in the base data file.
Returns:
The MMAX2DiscourseElement at discourse position discoursePosition.

getDiscourseElementByID

MMAX2DiscourseElement getDiscourseElementByID(java.lang.String discourseElementID)
(API) Returns the MMAX2DiscourseElement object (i.e. base data element) associated with the ID discourseElementID (e.g. 'word_4'), or null if none exists.

Parameters:
discourseElementID - The ID of the MMAX2DiscourseElement to return.
Returns:
The MMAX2DiscourseElement with ID discourseElementID.

getDiscourseElements

MMAX2DiscourseElement[] getDiscourseElements()
(API) Returns an array containing all MMAX2DiscourseElement objects in the current discourse, ordered in discourse order.

Returns:
An array of all MMAX2DiscourseElement objects in the current discourse.

getDiscourseElements

MMAX2DiscourseElement[] getDiscourseElements(Markable markable)
(API) Returns an array containing all MMAX2DiscourseElement objects in Markable markable, ordered in discourse order.

Parameters:
markable - The Markable object whose MMAX2DiscourseElement objects are to be returned.
Returns:
An array of all MMAX2DiscourseElement objects in Markable markable.

getNextDiscourseElement

MMAX2DiscourseElement getNextDiscourseElement(MMAX2DiscourseElement currentElement)
(API) Returns the MMAX2DiscourseElement object at discourse position currentElement.DiscourseElementAPI.getDiscoursePosition()+1, or null if none exists at this position.

Parameters:
currentElement - The MMAX2DiscourseElement object at the current position, or null.
Returns:
The MMAX2DiscourseElement object at discourse position currentElement.DiscourseElementAPI.getDiscoursePosition()+1, or null if none exists at this position. If currentElement is null, the first MMAX2DiscourseElement object in the current discourse is returned.

getPreviousDiscourseElement

MMAX2DiscourseElement getPreviousDiscourseElement(MMAX2DiscourseElement currentElement)
(API) Returns the MMAX2DiscourseElement object at discourse position currentElement.DiscourseElementAPI.getDiscoursePosition()-1, or null if none exists at this position.

Parameters:
currentElement - The MMAX2DiscourseElement object at the current position, or null.
Returns:
The MMAX2DiscourseElement object at discourse position currentElement.DiscourseElementAPI.getDiscoursePosition()-1, or null if none exists at this position. If currentElement is null, the last MMAX2DiscourseElement object in the current discourse is returned.

getDiscourseElementCount

int getDiscourseElementCount()
(API) Returns the number of MMAX2DiscourseElement objects in this discourse.

Returns:
The number of MMAX2DiscourseElement objects in this discourse.