Possible Bug with Sentence Chunk

Discussion about LiveCode Global Jam events and activities

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

Possible Bug with Sentence Chunk

Post by Peter Wood » Sat May 24, 2014 2:52 pm

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. ***

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: Possible Bug with Sentence Chunk

Post by DarScott » Sat May 24, 2014 3:39 pm

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!

Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

Re: Possible Bug with Sentence Chunk

Post by Peter Wood » Sun May 25, 2014 12:11 am

If the space at the end of the sentence is correct, then the dictionary entry is incorrect. I will file a bug.

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: Possible Bug with Sentence Chunk

Post by DarScott » Sun May 25, 2014 12:20 am

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.

Locked

Return to “LiveCode Global Jam”