View Single Post
Old 08-20-2013, 02:34 PM   #1
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Smart Quotes help (for Sigil plugin)

I'm working on a python script which hopefully will be an improvement on smartypants (used by plugin for Sigil), and would like some help with regards as what doesn't work correctly.

The ones I don't think will ever be satisfactorily solved will be where there's words which start with an apostrophe, such as
'Twas brillig, and the slithy toves....
(Having said that, I could have a list of known 'words - 'tis, 'twas 'cause etc.)

If you've got any known flubs, please can you let me know, with a small example as well if possible, and what it should look like when done correctly.

Ones like
Code:
John said, "The man said 'aaaaa'
" 'bbbb'
" 'cccc'
" dddd
" and then ended the story."
WRONG:
Code:
John said, “The man said ‘aaaaa’
 ” ‘bbbb’
 “ ‘cccc’
 ” dddd
 ” and then ended the story.”

RIGHT:
Code:
John said, “The man said ‘aaaaa’
 “ ‘bbbb’
 “ ‘cccc’
 “ dddd
 “ and then ended the story.”
The code I've got at moment does all the ones I've got correctly (including the above) - just need further test cases.

Thanks for any cases given.
Perkin is offline   Reply With Quote