Re: Replacing Codes with Text
Re: Replacing Codes with Text
- Subject: Re: Replacing Codes with Text
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 16 Jun 2001 06:20:50 -0700
On 6/15/01 5:27 PM, "email@hidden" <email@hidden> wrote:
>
Since there is a large number of possibilities and only a few codes in the
>
actual list, I'd scan through the lists and search the translation table for
>
each. You can start with your translation table as a text file, as you
>
suggest,
>
in any easy-to-parse form. Akua Sweets' "decompose" does this easily in one
>
command. So, break this input down into,
>
>
{ {"agn", "Agnes" }, {"bal", "Baldo"},...}
>
>
Now, you can sort this list using "order list" from Akua Sweets. Then, scan
>
through your input list, do a binary search for the three-letter code
>
(referring
>
to "item 1 of item N of codetable" and moving N up or down by powers of two
>
depending on whether that item is less than or greater than what you are
>
searching for.) Once you find it, put the corresponding value on the end of
>
your output list.
Actually, Scott, once you're using Akua, why not also use 'collect items of
codeTable that match "bal" in position 1 with just contents'? I've found
that doing the repeat loops can be quicker (if it matters), which is one
reason I submitted a solution with repeat loops, but it's hard to beat the
convenience. I'm looking forward to the performance boost when Greg converts
Akua to PPC native, although it looks like that will now happen only when
Apple makes the documentation available for facilitating conversion of
classic osaxen to OS X as well.
--
Paul Berkowitz