Commit 91498743 authored by Jeremy B. Merrill's avatar Jeremy B. Merrill

fix and test to ensure appositives are surrounded by commas on both sides

Former-commit-id: 402c87f4a932f79410e8c5d174f587039ff0e670
parent d6c72c2d
......@@ -196,10 +196,7 @@ public class OrthographyProcessor extends NLGModule {
if(postmod.getFeatureAsBoolean(Feature.APPOSITIVE)) {
buffer.append(", ");
buffer.append(realise(postmod));
if(i < len - 1) {
buffer.append(", ");
}
buffer.append(", ");
} else {
buffer.append(realise(postmod));
if(postmod instanceof ListElement
......
......@@ -612,6 +612,6 @@ public class NounPhraseTest extends SimpleNLG4Test {
_rott.setFeature(Feature.APPOSITIVE, true);
_dog.addPostModifier(_rott);
SPhraseSpec _sent = this.phraseFactory.createClause(_dog, "ran");
Assert.assertEquals("The dog, a rottweiler runs.", this.realiser.realiseSentence(_sent));
Assert.assertEquals("The dog, a rottweiler, runs.", this.realiser.realiseSentence(_sent));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment