arthurfiddich / simplenlg

Automatically exported from code.google.com/p/simplenlg
0 stars 0 forks source link

setObject doesn't clear last setObject #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

Code: 

p.setSubject("I");
p.setVerb("see");
p.setObject("a dog");
p.setObject("a cat");
p.setObject("a wolf");

Expected output:

I see a wolf.

Actual output:

I see a dog a cat a wolf.

Original issue reported on code.google.com by ital...@gmail.com on 24 Mar 2011 at 7:37

GoogleCodeExporter commented 8 years ago
Resolved: addObject() -- which was just a utility method -- was calling 
addComplement() without resetting the complements. There are now new 
setComplement methods in PhraseElement, and addObject calls setComplement.

Original comment by bertug...@gmail.com on 31 Mar 2011 at 6:45