p and q are 1-byte literals.
----- Original Message -----
From: bill lam <[EMAIL PROTECTED]>
Date: Tuesday, November 7, 2006 6:58 pm
Subject: Re: [Jprogramming] character mappings
> Roger Hui wrote:
> > The monad p {~ q i. ] where p and q are
> > literal lists and the argument is a literal array,
> > is useful. For example:
> >
> > 'AA aa'=: a.{~ 65 97 +/i.26
> > lc=: (aa,a.) {~ (AA,a.) i. ]
> > lc 'United States of America, Union of South Africa'
> > united states of america, union of south africa
> >
> > It looks like a good candidate for special code:
> >
> > x=: (1e6 [EMAIL PROTECTED] 256){a.
> > 6!:2 'lc x'
> > 0.035136
> > t=: AA,a.
> > 6!:2 't i. x'
> > 0.008995
> >
> > The gain should be about a factor of 4 in time and
> > a factor of 5 in space.
> >
> >
> >
> does it also recongnise the pattern
> (p {~ q i. ]) ::]"0
>
> as for unicode, 2^16 rather 256 characters have to be otherwise
> appended.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm