Page 1 of 1

Possible Bug with Sentence Chunk

Posted: Sat May 24, 2014 2:52 pm
by Peter Wood
In 7.0 DP5, a sentence chunk includes the space after the full stop. An example in the dictionary entry for excludes the space following the full stop.

Code in Message Box

Code: Select all

put "The cat sat on the mat. The mat was on the floor." into tText
put "***" & the first sentence of tText & "***"
Result

Code: Select all

***The cat sat on the mat. ***

Re: Possible Bug with Sentence Chunk

Posted: Sat May 24, 2014 3:39 pm
by DarScott
I'm guessing that the LiveCode sentence is based on text segmentation in Unicode 6.3. A sentence in 6.3 includes the ending punctuation, trailing spaces and paragraph separator (including CRLF, ASCII CR, LF and PS).

I don't know how strict LiveCode is in using the Unicode definition of sentence, but based on your test, it seems to be leaning that way.

I had missed sentences in the new things. Thanks for checking them out!

Re: Possible Bug with Sentence Chunk

Posted: Sun May 25, 2014 12:11 am
by Peter Wood
If the space at the end of the sentence is correct, then the dictionary entry is incorrect. I will file a bug.

Re: Possible Bug with Sentence Chunk

Posted: Sun May 25, 2014 12:20 am
by DarScott
I think you are right. The dictionary passes the buck by saying "delimited by Unicode sentence breaks, as determined by the ICU library", but the examples might be contrary to that.