public class ForwardConjunctionReductionRule extends AggregationRule
Implementation of the forward conjunction rule. Given two sentences
s1 and s2, this rule elides any constituent in the
left periphery of s2 which is also in s1. The left
periphery in simplenlg is roughly defined as the subjects, front modifiers
and cue phrase of an SPhraseSpec.
This rule elides any constituent in the left periphery of s2
which is lemma-identical to a constituent with the same function in
s1, that is, it is headed by the same lexical item, though
possibly with different inflectional features and/or modifiers. Note that
this means that the tall man and the man are counted as
"identical" for the purposes of this rule. This is only justifiable insofar
as the two NPs are co-referential. Since SimpleNLG does not make assumptions
about the referentiality (or any part of the semantics) of phrases, it is up
to the developer to ensure that this is always the case.
The current implementation is loosely based on the algorithm in Harbusch and Kempen (2009), which is described here: http://aclweb.org/anthology-new/W/W09/W09-0624.pdf
Implementation note: The current implementation only applies ellipsis to phrasal constituents (i.e. not to their component lexical items).
Note:: this rule can be used in conjunction with the
BackwardConjunctionReductionRule in Aggregator.
factory| Constructor and Description |
|---|
ForwardConjunctionReductionRule()
Creates a new
ForwardConjunctionReduction. |
| Modifier and Type | Method and Description |
|---|---|
NLGElement |
apply(NLGElement previous,
NLGElement next)
Applies forward conjunction reduction to two NLGElements e1 and e2,
succeeding only if they are clauses (that is, e1.getCategory() ==
e2.getCategory ==
PhraseCategory.CLAUSE) and
the clauses are not passive. |
apply, apply, getFactory, setFactorypublic ForwardConjunctionReductionRule()
ForwardConjunctionReduction.public NLGElement apply(NLGElement previous, NLGElement next)
PhraseCategory.CLAUSE) and
the clauses are not passive.apply in class AggregationRuleprevious - the first phrasenext - the second phrasenull otherwiseCopyright © 2020. All Rights Reserved.