View Single Post
Old 05-16-2007, 02:41 PM   #13
EatingPie
Blueberry!
EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.
 
EatingPie's Avatar
 
Posts: 888
Karma: 133343
Join Date: Mar 2007
Device: Sony PRS-500 (RIP); PRS-600 (Good Riddance); PRS-505; PRS-650; PRS-350
Hi Lee.

Thanks for the comments. Actually, your fix was dead-on.

Turns out the default case for the single-quotes will handle what you're talking about above. Even your questions about "boundary conditions" (end-of-line -- technically, end of paragraph -- and whatnot) would be handled correctly.

The part that caused the crash is a check for the NEXT single-quote, not the one the algorithm is currently changing into curly-open/close. Why I do this involves typographic conventions for contractions ("tell 'im to go to away") vs. quotations ('go away') -- they're different. The algorithm is trying to decide the "right thing" by looking ahead. Avoiding the crash is what matters at that point, and then the default case will be correct (if next quote's at end-of-line, the current one is an open-quote).

I just have to post your fix as promised... and I don't have "too much sushi!" as an excuse this morning.

-Pie
EatingPie is offline   Reply With Quote