johnGoToThePark.setFeature(Feature.NEGATED, true); // set negated
// note that constituents (such as subject and object) are set with setXXX methods
// while features are set with setFeature
DocumentElement sentence = nlgFactory // create a sentence DocumentElement from SPhraseSpec
.createSentence(johnGoToThePark);
// below creates a sentence DocumentElement by concatenating strings
StringElement hePlayed = new StringElement("he played");
StringElement there = new StringElement("there");
WordElement football = new WordElement("football");
DocumentElement sentence2 = nlgFactory.createSentence();
sentence2.addComponent(hePlayed);
sentence2.addComponent(football);
sentence2.addComponent(there);
// now create a paragraph which contains these sentences
DocumentElement paragraph = nlgFactory.createParagraph();
paragraph.addComponent(sentence);
paragraph.addComponent(sentence2);
// create a realiser. Note that a lexicon is specified, this should be
// the same one used by the NLGFactory
Realiser realiser = new Realiser(lexicon);
//realiser.setDebugMode(true); // uncomment this to print out debug info during realisation