Jump to content
Michael Hannah

Location trailing comma bug?

Recommended Posts

I have been struggling in Version 6.08 with sentence constructions that contain the location variable plus optional variables following the location variable before a period, then more variables after theperiod. I believe there might be a small bug in the way the punctuation is automatically constructed. It appears that whenever

a) there is not an explicit period immediately following the [L] variable in the sentence construction, and

B) there is an optional variable following the [L] variable but that optional variable is empty, and

c) there is an explicit period following this optional variable, and

d) there is yet more to the sentence, such as another non-empty optional variable, then

a comma following the Location variable but immediately preceding the explicit period which follows the empty variable is not stripped.

 

The simplest test I have come up with is a tag with sentences:

[P] was tested .

[W] witnessed testing [P] .

 

M1=xx, M2=yy, WM=zz, (all variables exist) is OKAY producing

"P was tested location, xx. yy."

"W witnessed testing P location, xx. zz."

M1=xx, M2=, WM=zz, is also OKAY producing

"P was tested location, xx."

"W witnessed testing P location, xx. zz."

 

BUT

 

M1=, M2=yy, WM=zz, produces ending comma-period in both

"P was tested location,. yy."

"W witnessed testing P location,. zz."

M1=, M2=, WM=zz, strips the comma in the Principal sentence but leaves the ending comma-period in Witness

"P was tested location."

"W witnessed testing P location,. zz."

 

Since the sentences produce correct punctuation for all conditions of the presence or absence of the optional variables when the location field is empty, the extra comma is clearly coming from the location field.

 

I understand that this is an intentionally convoluted case, but the even simpler case where you just want your memo as part of the end of the sentence like:

[P] was tested

[W] witnessed testing [P] .

when the memo is empty produces an appropriate principal sentence, but the witness sentence has the comma-period.

 

Note that the following strips the comma and produces the expected punctuation no matter what variables exist:

[P] was tested .

[W] witnessed testing [P] .

In this case the program seems to detect that a period follows the Location variable and strips the comma correctly.

 

Since there are cases where the trailing comma from the Location field are stripped, I presume the cases where the comma-period pair is produced are bugs?

 

Or is this wierd case too hard to detect for stripping?

Seems like the code should construct the sentence then ask something like "Is the next non-blank character following the location field a punctuation character? If so, strip the trailing comma from Location."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×