Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrogative Types for Second Person #1

Open
Barachia opened this issue Feb 25, 2020 · 1 comment
Open

Interrogative Types for Second Person #1

Barachia opened this issue Feb 25, 2020 · 1 comment

Comments

@Barachia
Copy link

Barachia commented Feb 25, 2020

Describe the bug
When creating an interrogative type question, the verb does not pick the correct form.

To Reproduce
Steps to reproduce the behavior:

Lexicon lexicon = new XMLLexicon();
NLGFactory nlg = new NLGFactory(lexicon);
Realiser realiser = new Realiser();
SPhraseSpec clause = nlg.createClause("you", "think");
PPPhraseSpec aboutJohn = nlg.createPrepositionPhrase("about", "John");
clause.addPostModifier(aboutJohn);
clause.setFeature(Feature.INTERROGATIVE_TYPE,InterrogativeType.WHAT_OBJECT);
String realisation = realiser.realiseSentence(clause);

The result is:

What does you think about John?

Expected behavior
The result should be:

What do you think about John?

Screenshots
If applicable, add screenshots to help explain your problem.

Java version
Tested with JDK 8 and 13.

Additional context
It seems that in the original SimpleNLG there is a test in which it selects the appropriate verb. See the method testWhatObjectInterrogative() at line 814. The same goes for a Dutch sentence, configured like this:

Lexicon lexicon = new simplenlg.lexicon.dutch.XMLLexicon();
NLGFactory nlg = new NLGFactory(lexicon);
Realiser realiser = new Realiser();

SPhraseSpec phrase = nlg.createClause();
NPPhraseSpec subject = nlg.createNounPhrase("Jij");
subject.setFeature(Feature.PRONOMINAL, true);
subject.setFeature(Feature.PERSON, Person.SECOND);
phrase.setSubject(subject);
phrase.setVerb("doen");
phrase.setObject("dat");
phrase.setFeature(Feature.INTERROGATIVE_TYPE, InterrogativeType.WHY);
phrase.setFeature(Feature.TENSE, Tense.PRESENT);
String result = realiser.realiseSentence(phrase);

The result: Waarom doet jij dat?, the expected result is Waarom doe jij dat?

For the What do you think about John? sentence, the contents of the realization:

SimpleNLG NL:
{realisation=null, category=SENTENCE, features={interrogative=true, textComponents=[InflectedWordElement[what:NOUN], [InflectedWordElement[do:VERB]], [InflectedWordElement[you:PRONOUN]], [InflectedWordElement[think:VERB], [[InflectedWordElement[about:PREPOSITION], [InflectedWordElement[John:ANY]]]]]]}}

Debug: link

Original
{realisation=null, category=SENTENCE, features={interrogative=true, textComponents=[InflectedWordElement[what:PRONOUN], InflectedWordElement[do:VERB], InflectedWordElement[you:PRONOUN], [InflectedWordElement[think:VERB], [[InflectedWordElement[about:PREPOSITION], InflectedWordElement[John:ANY]]]]]}}

Debug: link

It could have to do with that What is a pronoun in the one case, and a noun in the other case?

@Barachia
Copy link
Author

It seems to have to do with the morphology of the verb buildPresentVerbPhrase()when there is an interrogative type, then also the Dutch version works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant