-
Notifications
You must be signed in to change notification settings - Fork 3
Section 6 Verbs
In the sample Java class TestMain shown above, we have the statements:
Verbs should be specified in infinitive ("to XXX") form. For example:
p.setVerb("be");
As a convenience, SimpleNLG-NL will usually accept inflected forms of verbs as well. E.g.
p.setVerb("is");
You can specify English particles (prepositions which accompany a verb) by writing the following:
p.setVerb("pick up");
p.setVerb("put down");
In Dutch, there is a special class of verbs called Separable Complex Verbs (SCVs) (scheidbaar samengestelde werkwoorden), e.g wegrennen, doorgaan, afdwalen, ... These can be split into their a 'preverb' (often prepositions) and a main verb. This is necessary to position the preverb correctly or to perform morphological tasks properly. For example wegrennen "to run away" has to be divided into weg and rennen so we can create the proper sentence Ik ren weg "I run away".
SimpleNLG-NL's lexicon contains information about SCVs in the form of the <preverb></preverb>
field. If the verb is not in the lexicon, SimpleNLG-NL tests the verb for common preverbs.
User can manually indicate an SCV by adding a pipe (|
) after the preverb:
p.setVerb("weg|rennen");
or by setting the Dutch preverb feature on the VPPhraseSpec
element:
VPPhraseSpec verb = nlgFactory.createVerbPhrase("wegrennen");
verb.setFeature(DutchFeature.PREVERB, "weg");
p.setVerb("verb");
Verbs in SimpleNLG-NL can have one of four different tenses: past, present, future and conditional (verleden tijd, tegenwoordige tijd, toekomende tijd and verleden toekomende tijd). Let’s say we’ve written the following SimpleNLG-NL code which yields the sentence "Marie gooit de bal.":
SPhraseSpec p = nlgFactory.createClause();
p.setSubject("Marie");
p.setVerb("gooien");
p.setObject("de bal");
In order to set this in the past, we would add the line:
p.setFeature(Feature.TENSE, Tense.PAST);
thus rendering the sentence "Marie gooide de bal."
If Marie is instead busy with other things and forced to postpone her exercise, we could write:
p.setFeature(Feature.TENSE, Tense.FUTURE);
yielding the sentence "Marie zal de bal gooien."
If NEGATED
is set to true, the negative form of the sentence is produced. For example adding the following line to the previous example:
p.setFeature(Feature.NEGATED, true);
will change the resulting sentence to:
Marie zal niet de bal gooien.
As word order in Dutch is very flexible, the negation adverb (niet) may be positioned different than you expected. There is currently no proper way to change it.
You may want to use a different negation adverb, such as geen "no"/"none". You can do so using the following Dutch feature:
p.setFeature(DutchFeature.NEGATION_AUXILIARY, "geen");
Which results in: Marie zal geen bal gooien.
Currently, SimpleNLG-NL does not automatically remove the specifier from the object. You'll have to leave the specifier out.
Interrogative sentences (vraagzinnen) are partially supported in SimpleNLG-NL (in some cases, the word order may be incorrect). Just build the sentence as you would with a regular sentence and add the INTERROGATIVE_TYPE
feature to it.
For example:
p.setSubject("Marie");
p.setVerb("gooit");
p.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHAT_OBJECT);
will generate "Wat gooit Marie?"
→ For more examples on questions, look at testsrc/InterrogativeTest.java
.
→ For more examples on verbs, look at testsrc/VerbPhraseTest.java
.
Features TENSE
, NEGATED
, and INTERROGATIVE_TYPE
are examples of features which can be set on a SPhraseSpec
. Many other features are also allowed, including MODAL
, PASSIVE
, PERFECT
, and PROGRESSIVE
. Detailed information about allowable features are given in the SimpleNLG API documentation.