AnantLabs / simplenlg

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

Problems with "a" to "an" in front of vowel sounds in some conditions in 4.2, that worked OK in 4.1 #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Create a noun phrase with specifier "a" on the noun.
Put a premodifier CoordinatedPhraseElement in the phrase, where the premodifier 
should cause "a" to change to "an"

eg.

Instead of getting "an elongated, red ball", I get "a elongated, red ball"

A second problem occurs when trying to work around the fact that simplenlg 
can't produce "an 80% change" and "a 70% change" when the specifier is "a". So 
I make a noun phrase with no specifier and two premodifier StringElements "an" 
and "80%" to get

I used to get 

"an 80% stenosis"

now I get

"an, 80% stenosis."

I need another work-around, or perhaps a change to simplenlg to handle numbers.

Original issue reported on code.google.com by ChristopherCHowell@gmail.com on 8 Apr 2011 at 9:34

GoogleCodeExporter commented 9 years ago
It may not have worked in 4.1. I made local changes to 4.1 
MorphologyProcessor.java.
The unified diff is attached.

Original comment by ChristopherCHowell@gmail.com on 11 Apr 2011 at 2:14

Attachments:

GoogleCodeExporter commented 9 years ago
This has now been fixed. 

The problem with coordinate premodifiers was related to the way 
CoordinatePhraseElements were being handled by the MorphologyProcessor. The 
problem with numbers has also been resolved. 

See NounPhraseTest.testAAnCoord() and NounPhraseTest.testAAnCoordWithNumbers() 
for example usage.

Original comment by bertug...@gmail.com on 14 Apr 2011 at 7:05