public class PPPhraseSpec extends PhraseElement
This class defines a prepositional phrase. It is essentially
a wrapper around the PhraseElement class, with methods
for setting common constituents such as object.
For example, the setPreposition method in this class sets
the head of the element to be the specified preposition
From an API perspective, this class is a simplified version of the PPPhraseSpec
class in simplenlg V3. It provides an alternative way for creating syntactic
structures, compared to directly manipulating a V4 PhraseElement.
Methods are provided for setting and getting the following constituents:
NOTE: PPPhraseSpec do not usually have modifiers or (user-set) features
PPPhraseSpec are produced by the createPrepositionalPhrase
method of a PhraseFactory
features| Constructor and Description |
|---|
PPPhraseSpec(NLGFactory phraseFactory) |
| Modifier and Type | Method and Description |
|---|---|
NLGElement |
getObject() |
NLGElement |
getPreposition() |
void |
setObject(Object object)
Sets the object of a PP
|
void |
setPreposition(Object preposition)
sets the preposition (head) of a prepositional phrase
|
addComplement, addComplement, addFrontModifier, addFrontModifier, addModifier, addPostModifier, addPostModifier, addPreModifier, addPreModifier, clearComplements, getChildren, getFrontModifiers, getHead, getPostModifiers, getPreModifiers, printTree, setComplement, setComplement, setDeterminer, setFrontModifier, setFrontModifier, setHead, setPostModifier, setPostModifier, setPreModifier, setPreModifierclearAllFeatures, 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 PPPhraseSpec(NLGFactory phraseFactory)
public void setPreposition(Object preposition)
public NLGElement getPreposition()
public void setObject(Object object)
public NLGElement getObject()
Copyright © 2020. All Rights Reserved.