Metalanguage (v0.3) for mxTextTools

Tony J Ibbs (Tibs)
Fri, 26 Nov 99 11:54:02 GMT

This is to announce v0.3 (tiepin) of my metalanguage translator for

Marc-André Lemburg provides mxTextTools, a package of fast text manipulation
tools for use with Python. The tagging engine within that package takes as
input a set of tuples, the Tag Table, which tells it what to do. Although
simple in format, these tuples aren't particularly readable, and indeed
Marc-André himself says:

"I admit, these tables don't look very elegant. In fact I would much rather
write them in some meta language that gets compiled into these tables
instead of handcoding them. But I've never had time to do much research into
this, so unless someone volunteers, it will stay like this for some time."

This version of the metalanguage translator implements enough notation to
allow its own tag tables to be written in the metalanguage. Although it
doesn't yet support various things (notably, strings with escaped quotation
marks, function calls, and embedded tables with T/F conditions) it already
provides enough power for most of my own needs, and should hopefully be
useful to other people.

Significant advantages of using the metalanguage are:
 * it avoids the problem of counting (and recounting) offsets between tuples
 * it avoids the pitfall of forgetting a comma between two tuples (which on
   my Windows machine at home is enough to crash Python)
 * it enforces indentation for meaning in the same way that Python itself
 * it provides an "if" construct
 * obviously, I believe it to be more readable than the bare tuple notation

Licensing: I like the Python Powered license at
so please apply that with suitable amendments. Although Marc-André is aware
of this work, it is in no way his fault (apart from the quote above and some
helpful comments, for which thanks), so don't blame him...

Note that mxTextTools v1.1.1 or later is required to use the translator.

The metalanguage description and translator is available at

mxTextTools itself is available at

<P><A HREF="">Metalanguage
v0.3 for mxTextTools</A> - a little language (and its translator) to make it
easier to write mxTextTools tag tables.  (24-Nov-99)

Tony J Ibbs (Tibs)
Feet first with 5 wheels...
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)

----------- comp.lang.python.announce (moderated) ----------
Article Submission Address:
Python Language Home Page:
Python Quick Help Index: