Re: smart quote algorithm


Subject: Re: smart quote algorithm
From: Pierre Abbat (phma@oltronics.net)
Date: Thu Jul 20 2000 - 18:14:02 CDT


>OK, first an easy exception case: If ASCII (single) quote (but not
>ASCII backquote) appears between two ALPHAs, it may be treated as an
>apostrophe and converted to its curly form. Otherwise, it is treated
>like all other QUOTEs and follows the normal algorithm.
>
>Given a QUOTE character, these conditions are logically tested in
>order:
>
>1. If a QUOTE is immediately preceded by a curly quote of opposite
>parity, it is converted to a curly quote in the same direction.
>
>2. If a QUOTE is immediately preceded by a curly quote of the same
>parity, it is converted to a curly quote of opposite direction.
>
>3. If a QUOTE is immediately followed by a curly quote of opposite
>parity, it is converted to a curly quote in the same direction.
>
>4. If a QUOTE is immediately followed by a curly quote of the same
>parity, it is converted to a curly quote of opposite direction.
>
>[[The above cases are intended to handle normal nested quotes or cases
>where quotes enclose empty strings. Different cultures use different
>parities as start points for nested quotes, but the algorithm doesn't
>care.]]
>
>5. If a QUOTE is in isolation, it is not converted. It is in
>isolation if it is immediately preceded and followed by either a BREAK
>or white space. The things before and after it don't have to be of
>the same type.
>
>6. If a QUOTE is immediately preceded by a BREAK or white space and
>is immediately followed by anything other than a BREAK or white space,
>it is converted to the opening form of curly quote.
>
>7. If a QUOTE is immediately followed by a BREAK, white space, or
>PUNCT and is immediately preceded by anything other than BREAK or
>white space, it is converted to the closing form of curly quote.
>
>8. Any other QUOTE is not converted.

What happens to the following?
'''
'"'"

phma



This archive was generated by hypermail 2b25 : Thu Jul 20 2000 - 18:15:44 CDT