Commit fa07499b authored by Saad Mahamood's avatar Saad Mahamood Committed by GitHub

Merge pull request #38 from jeremybmerrill/appositivepr

fix and test to ensure appositives are surrounded by commas on both sides
parents d6c72c2d 91498743
......@@ -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