WHO subject questions

55 views
Skip to first unread message

Ivana D.

unread,
Nov 22, 2017, 2:29:31 PM11/22/17
to simplenlg
Hi,

I've the following problem with generating who subject questions: E.g. the input sentence "I am eating pizza right now" (code):

String sentence = "I am eating pizza right now.";

Lexicon lexicon = Lexicon.getDefaultLexicon();
NLGFactory nlgFactory = new NLGFactory(lexicon);
Realiser realiser = new Realiser(lexicon);

SPhraseSpec f = nlgFactory.createClause();

f.setSubject("I");
f.setObject("pizza");
f.setVerb("eat");
f.addPostModifier("right now");
f.setFeature(Feature.TENSE, Tense.PRESENT);
f.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHO_SUBJECT);
f.setFeature(Feature.PROGRESSIVE, true);
f.setFeature(Feature.PASSIVE, false);
f.setFeature(Feature.PERFECT, false);
f.setFeature(Feature.NUMBER, Dictionaries.Number.SINGULAR);
f.setFeature(Feature.PERSON, Person.SECOND);

DocumentElement sent = nlgFactory.createSentence(f);

System.out.println( realiser.realise(sent).getRealisation());


The output of SimpleNLG is: "Who am eating pizza right now?". I found this error in other tenses like past continuous, present continuos, present perfect and present perfect continuos. All other tenses are OK including present simple, like: "I eat a pizza" will be correctly transformed to "Who eats a pizza".

Is there a fix or workaround available to get a correct output?

Thanks in advance,

Ivana
Reply all
Reply to author
Forward
0 new messages