public class CoordinatedPhraseElement extends NLGElement
This class defines coordination between two or more phrases. Coordination involves the linking of phrases together through the use of key words such as and or but.
The class does not perform any ordering on the coordinates and when realised they appear in the same order they were added to the coordination.
As this class appears similar to the PhraseElement class from an
API point of view, it could have extended from the PhraseElement
class. However, they are fundamentally different in their nature and thus
form two distinct classes with similar APIs.
features| Constructor and Description |
|---|
CoordinatedPhraseElement()
Creates a blank coordinated phrase ready for new coordinates to be added.
|
CoordinatedPhraseElement(Object coordinate1,
Object coordinate2)
Creates a coordinated phrase linking the two phrase together.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComplement(NLGElement newComplement)
Adds a new complement to the phrase element.
|
void |
addComplement(String newComplement)
Adds a new complement to the phrase element.
|
void |
addCoordinate(Object newCoordinate)
Adds a new coordinate to this coordination.
|
void |
addPostModifier(NLGElement newPostModifier)
Adds a new post-modifier to the phrase element.
|
void |
addPostModifier(String newPostModifier)
Adds a new post-modifier to the phrase element.
|
void |
addPreModifier(NLGElement newPreModifier)
Adds a new pre-modifier to the phrase element.
|
void |
addPreModifier(String newPreModifier)
Adds a new pre-modifier to the phrase element.
|
boolean |
checkIfPlural() |
void |
clearCoordinates()
Clears the existing coordinates in this coordination.
|
List<NLGElement> |
getChildren()
Retrieves the children for this element.
|
List<NLGElement> |
getComplements()
Retrieves the list of complements currently associated with this
coordination.
|
String |
getConjunction() |
NLGElement |
getLastCoordinate()
A convenience method for retrieving the last coordinate in this
coordination.
|
List<NLGElement> |
getPostModifiers()
Retrieves the list of post-modifiers currently associated with this
coordination.
|
List<NLGElement> |
getPreModifiers()
Retrieves the list of pre-modifiers currently associated with this
coordination.
|
String |
printTree(String indent) |
void |
setConjunction(String conjunction)
set the conjunction to be used in a coordinatedphraseelement
|
clearAllFeatures, equals, equals, getAllFeatureNames, getAllFeatures, getCategory, getFactory, getFeature, getFeatureAsBoolean, getFeatureAsDouble, getFeatureAsElement, getFeatureAsElementList, getFeatureAsFloat, getFeatureAsInteger, getFeatureAsList, getFeatureAsLong, getFeatureAsString, getFeatureAsStringList, getParent, getRealisation, getTense, hasFeature, isA, isNegated, isPlural, removeFeature, setCategory, setFactory, setFeature, setFeature, setFeature, setFeature, setFeature, setFeature, setNegated, setParent, setPlural, setRealisation, setTense, toStringpublic CoordinatedPhraseElement()
public void addCoordinate(Object newCoordinate)
NLGElement then it is added directly to the coordination. If
the new coordinate is a String a StringElement
is created and added to the coordination. StringElements
will have their complementisers suppressed by default. In the case of
clauses, complementisers will be suppressed if the clause is not the
first element in the coordination.newCoordinate - the new coordinate to be added.public List<NLGElement> getChildren()
NLGElementgetChildren in class NLGElementList of NLGElements representing the
children of this element.public void clearCoordinates()
removeFeature(Feature.COORDINATES).public void addPreModifier(NLGElement newPreModifier)
newPreModifier - the new pre-modifier as an NLGElement.public void addPreModifier(String newPreModifier)
newPreModifier - the new pre-modifier as a String. It is used to
create a StringElement.public List<NLGElement> getPreModifiers()
List of NLGElements.public List<NLGElement> getComplements()
List of NLGElements.public void addPostModifier(NLGElement newPostModifier)
newPostModifier - the new post-modifier as an NLGElement.public void addPostModifier(String newPostModifier)
newPostModifier - the new post-modifier as a String. It is used to
create a StringElement.public List<NLGElement> getPostModifiers()
List of NLGElements.public String printTree(String indent)
printTree in class NLGElementpublic void addComplement(NLGElement newComplement)
newComplement - the new complement as an NLGElement.public void addComplement(String newComplement)
newComplement - the new complement as a String. It is used to
create a StringElement.public NLGElement getLastCoordinate()
NLGElementpublic void setConjunction(String conjunction)
public String getConjunction()
public boolean checkIfPlural()
Copyright © 2020. All Rights Reserved.