I usually convert all kinds of quotation marks into \quotation{} / \quote{} using the regex search of my editor; a regex replacement is also part of my docx-to-ConTeXt converter script. (I see no need to avoid regexes, but YMMV.) The biggest problem I face are mixed and wrong quotation marks, e.g. English marks in a German text, a mixture of curly/straight marks, traditional LaTeX q. marks and similar mistakes. Some programs have a default of English single quotes with German double quotes :( In what kind of workflows does your program make sense? (Please don’t be offended, my view is limited.) Hraban
Am 17.06.2021 um 22:28 schrieb Thangalin
: 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/re...
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! ___________________________________________________________________________________ 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 ___________________________________________________________________________________