-
Notifications
You must be signed in to change notification settings - Fork 3
Section 7 What are complements
This page is based on a page of the wiki for the original SimpleNLG.
As far as SimpleNLG is concerned, a complement is anything that comes after the verb. When you label something as a complement and hand it to SimpleNLG to be realized, SimpleNLG will place it after the verb [1]. If you've specified an object, it will place it after both the verb and the object. When using the Dutch language: if there is only one complement, is it placed before the object. Currently is does so for sentences in the PERFECT
form, too, which is often unwanted (e.g. Marie heeft de brief snel geschreven. is correct). For now, this can be corrected by adding the adverb as a premodifer to the verb. With more than one complement, all complements are added to the end of the sentence, as in other languages.
Examples of complements are italicized in the sentences below:
- Marie is blij.
- Marie schreef snel de brief.
- Marie realiseerde zich dat haar vakantie voorbij is.
The italicized words and phrases in the examples above are all different parts of speech. In example #1, it's an adjective phrase; in example #2, it's an adverb; and it’s a ‘that-clause’ (complementiser phrase) in example #3. But from SimpleNLG’s point of view, the italicized bits all have one thing in common: they are complements and appear after the verb. Although it has an understanding of subjects, verbs, and objects, SimpleNLG has a very limited concept of adjective phrases that follow verbs, adverbial phrases, that-clauses, or other parts of speech that can appear after a verb. But it does understand the concept of a complement, and because of this, phrases that appear after a verb can be generated using the SimpleNLG library. As can be seen in Table 2, complements encompass a variety of phrase types. (For a full listing of Parts of Speech SimpleNLG can handle, see Table 1.)
Complements can be added to sentences via the addComplement
method. For example, given our subject, object, and verb:
p.setSubject("Marie");
p.setVerb("gooien");
p.setObject("de bal");
We can then add any kind of complement:
p.addComplement("hard"); // Adverb phrase, passed as a string
p.addComplement("ondanks haar vermoeidheid"); // Prepositional phrase, string
Which will generate:
Marie gooit de bal hard ondanks haar vermoeidheid.
→ For more examples on complements, look at testsrc/FPTest.java
.
[1] Even if you label a nonsense string like "shabadoo" as a complement, SimpleNLG will happily add it after the verb.