ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Thangalin <thangalin@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Straight Quotes / Curly Quotes
Date: Thu, 17 Jun 2021 13:28:25 -0700	[thread overview]
Message-ID: <CAANrE7r3DDAGCKK4MtD8ur3-Ckh8vnO+cvh-ynsxB56X03eaWg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 813 bytes --]

I've written a Java-based lexer/parser that can convert straight quotes to
curly quotes for English prose. It's a one-pass algorithm (O(n)) that uses
neither look-behind nor regex. Here's a list of test cases it handles:

https://raw.githubusercontent.com/DaveJarvis/keenquotes/main/lib/src/test/resources/com/keenwrite/quotes/smartypants.txt

A test harness converted several Project Gutenberg texts quite well. The
folks at PG may be interested in using it themselves to help convert quotes
in older texts en masse. The source code is MIT-licensed:

https://github.com/DaveJarvis/keenquotes/

The code should port to Lua fairly easily, should anyone be interested in
adding a straight/curly quotation mark conversion module to ConTeXt.
(Similar to the LaTeX package, but without using regex.)

Cheers everyone!

[-- Attachment #1.2: Type: text/html, Size: 1152 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2021-06-17 20:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 20:28 Thangalin [this message]
2021-06-17 22:10 ` Henning Hraban Ramm
2021-06-17 22:35   ` Hans Hagen
2021-06-18  2:08   ` Thangalin
2021-06-18  6:09     ` Hans Hagen
2021-06-18 15:48       ` Thangalin
2021-06-18 17:12         ` Hans Hagen
2021-06-18 10:00     ` Henning Hraban Ramm
2021-06-18 16:05       ` Thangalin
2021-06-18 17:03         ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAANrE7r3DDAGCKK4MtD8ur3-Ckh8vnO+cvh-ynsxB56X03eaWg@mail.gmail.com \
    --to=thangalin@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).