AnantLabs / simplenlg

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

Specifying no conjunction in a sentence #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Specifying the empty string "" as a list conjunct should keep a conjunction 
from appearing in a sentence.

Doing this with coordinated phrase elements, I get a null:

       SPhraseSpec p = nlgFactory.createClause("I", "be", "happy");
       SPhraseSpec q = nlgFactory.createClause("I", "eat", "fish");
       CoordinatedPhraseElement pq = nlgFactory.createCoordinatedPhrase();
       pq.addCoordinate(p);
       pq.addCoordinate(q);
       pq.setFeature(Feature.CONJUNCTION, "");

Expected output:
I am happy I eat fish

Actual output:
I am happy null I eat fish.

Original issue reported on code.google.com by ital...@gmail.com on 30 Mar 2011 at 6:19

GoogleCodeExporter commented 9 years ago
In the current svn version, this isn't actaully a problem -- a new test in 
testsrc/CoordinationTest tries exactly the code given in the issue. The 
conjunction is not realised as "null". 

However, there was a minor bug fix in response to this issue: null or empty 
conjunctions were realised with an extra whitespace; this is now resolved.

Original comment by bertug...@gmail.com on 7 Apr 2011 at 12:49