Smart quotes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Max

    #1

    Smart quotes

    Anyone have a smart-quotes algorithm? Preferably in Java; python 2nd
    best; otherwise anything I can grok.

    Is there anything better (smarter) than:
    1) if the previous character was non-whitespace, this is a close
    2) else, if the next character is non-whitespace, this is an open
    ?

    --Max
  • Oliver Hirschi

    #2
    Re: Smart quotes


    "Max" <rabkin@mweb[DOT]co[DOT]za> schrieb im Newsbeitrag
    news:BqednRQkwp p81UDfRVn-uA@is.co.za...[color=blue]
    > Anyone have a smart-quotes algorithm? Preferably in Java; python 2nd
    > best; otherwise anything I can grok.
    >
    > Is there anything better (smarter) than:
    > 1) if the previous character was non-whitespace, this is a close
    > 2) else, if the next character is non-whitespace, this is an open
    > ?[/color]

    Yes, because there could be the the cases:
    - "1","2","3"
    - "1", "2", "3"
    - "1", "2 ","3"
    - "1"," 2"," 3"

    --> Use RegularExpressi ons!

    Regards.

    --
    Oliver Hirschi


    Comment

    Working...