public abstract class AggregationRule extends Object
apply(NLGElement, NLGElement) which takes an arbitrary number of
NLGElements and perform some form of aggregation
on them, returning an SPhraseSpec as a result, or
null if the operation fails.| Modifier and Type | Field and Description |
|---|---|
protected NLGFactory |
factory |
| Constructor and Description |
|---|
AggregationRule()
Creates a new instance of AggregationRule
|
| Modifier and Type | Method and Description |
|---|---|
List<NLGElement> |
apply(List<NLGElement> phrases)
Performs aggregation on an arbitrary number of elements in a list.
|
NLGElement |
apply(NLGElement phrase)
Perform aggregation on a single phrase.
|
abstract NLGElement |
apply(NLGElement sentence1,
NLGElement sentence2)
Performs aggregation on a pair of sentences.
|
NLGFactory |
getFactory() |
void |
setFactory(NLGFactory factory)
Set the factory that the rule should use to create phrases.
|
protected NLGFactory factory
public AggregationRule()
public void setFactory(NLGFactory factory)
factory - the factorypublic NLGFactory getFactory()
public List<NLGElement> apply(List<NLGElement> phrases)
apply(NLGElement, NLGElement) on all pairs of
elements in the list, recursively aggregating whenever it can.phrases - the sentencesapply(NLGElement, NLGElement) succeeds on s1
and s2, the list contains the result; otherwise, the list
contains s1 and s2.public NLGElement apply(NLGElement phrase)
CoordinatedPhraseElement, in which case it
calls apply(List) on the children of the coordinated phrase,
returning a coordinated phrase whose children are the result.public abstract NLGElement apply(NLGElement sentence1, NLGElement sentence2)
AggregationRule need to implement.sentence1 - the first sentencesentence2 - the second sentencenull
otherwiseCopyright © 2020. All Rights Reserved.