How to generate an interrogative "WHAT_OBJECT" phrase using SimpleNLG in Python3?

50 Views Asked by At

I would generate this question "What are the colors of lightsabers?".
I'm using the direct port of the java code of SimpleNLG in python and my version of python is 3.11.

This is my wrong solution, which generates "What are lightsaber the colors of?" How can i generate that in the clean and right way?

sentence = nlgFactory.createClause()
sentence.setSubject("lightsaber")
sentence.setPlural("true")
sentence.setVerb("be")
sentence.addFrontModifier("the colors of")
sentence.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHAT_OBJECT)
return realiser.realiseSentence(sentence)
0

There are 0 best solutions below