[6190] in cryptography@c2.net mail archive
Re: Export control of Java VM ??
daemon@ATHENA.MIT.EDU (Russell Nelson)
Thu Dec 2 17:05:18 1999
From: Russell Nelson <nelson@crynwr.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Date: Thu, 2 Dec 1999 16:57:27 -0500 (EST)
To: Ron Rivest <rivest@theory.lcs.mit.edu>
Cc: cryptography@c2.net
In-Reply-To: <199912021448.JAA11405@ibis.lcs.mit.edu>
Message-ID: <14406.59104.46249.207334@desk.crynwr.com>
Ron Rivest writes:
> (*) A Post tag system has a number of rewrite rules of the form
> L_i --> R_i
> where L_i and R_i are strings over some alphabet (e.g. binary).
> As long as the prefix of the input matches some L_i, that
> L_i is removed from the beginning of the input, and the
> replacement R_i is added to the end of the input.
You mean like:
#!/usr/bin/perl
# usage: post-tag '01-->02' '002-->3'
# tests: 01 002 010 00201
while($_=shift) {
die unless m/(.*)-->(.*)/;
push(@L, $1);
push(@R, $2);
}
while(<>) {
chomp;
do {
for($i=0; $i < @L; $i++) {
$l=$L[$i];
$r=$R[$i];
print "$_ trying $l-->$r\n";
last if s/^$l(.*)/$1$r/;
}
print "$_ restarting\n" if ($i < @L);
} while ($i < @L);
print "$_\n";
}
--
-russ nelson <sig@russnelson.com> http://russnelson.com
Crynwr sells support for free software | PGPok | Government schools are so
521 Pleasant Valley Rd. | +1 315 268 1925 voice | bad that any rank amateur
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | can outdo them. Homeschool!