Re: Sorted indexes and (string<?) in Jade

Subject: Re: Sorted indexes and (string<?) in Jade
From: Toby Speight <Toby.Speight@xxxxxxxxxxxxxx>
Date: 15 Sep 1998 15:44:16 +0100
Steve> Steve Tinney <URL:mailto:stinney@xxxxxxxxxxxxx>

0> In article <199809151409.KAA05361@xxxxxxxxxxxxxxxxxxx>, Steve
0> wrote:

Steve> I have solved this problem, sort of, in a slightly different
Steve> way.  I say sort of only because I don't currently use my
Steve> collate code in DSSSL, though I did hack it in.
Steve>
Steve> The basic idea is that one writes a sequence specification
Steve> once, which can then be converted to different forms.  At
Steve> present there are two converters, written in Perl, which make
Steve> C tables and a DSSSL alist respectively.

I now have a convertor from the tables supplied with Unicode TR-10
into a DSSSL alist, written as a Makefile:


## Makefile
# sorry about the long lines!

all: sorttable.dsl

sorttable.dsl: basekeys.dsl compkeys.dsl
	cat header.dsl >$@
	sed -e 's/^(#/;;&/' -e 's/^;;\((#\\U-00\)/\1/' -e 's/^;;\((#\\U-017[4-7]\)/\1/' -e 's/^/   /' basekeys.dsl >>$@
	sed -e 's/^(#/;;&/' -e 's/^;;\((#\\U-00\)/\1/' -e 's/^;;\((#\\U-017[4-7]\)/\1/' -e 's/^/   /' compkeys.dsl >>$@
	cat footer.dsl >>$@

%.dsl: %.txt
	sed -e 's/^\([0-9A-F][0-9A-F]*\) /(#\\U-\1 /' -e 's/ % /) ; /' \
	-e 's/\[\(.\)\([0-9A-F]*\)\.\([0-9A-F]*\)\.\([0-9A-F]*\)\.\([0-9A-F]*\)\]/(#\\\1 #x\2 #x\3 #x\4 #x\5)/g' \
	-e 's/\(#x[0-9a-fA-F]*\)A/\1a/g' -e 's/\(#x[0-9a-fA-F]*\)B/\1b/g' \
	-e 's/\(#x[0-9a-fA-F]*\)C/\1c/g' -e 's/\(#x[0-9a-fA-F]*\)D/\1d/g' \
	-e 's/\(#x[0-9a-fA-F]*\)E/\1e/g' -e 's/\(#x[0-9a-fA-F]*\)F/\1f/g' \
	-e 's/\(#x[0-9a-fA-F]*\)A/\1a/g' -e 's/\(#x[0-9a-fA-F]*\)B/\1b/g' \
	-e 's/\(#x[0-9a-fA-F]*\)C/\1c/g' -e 's/\(#x[0-9a-fA-F]*\)D/\1d/g' \
	-e 's/\(#x[0-9a-fA-F]*\)E/\1e/g' -e 's/\(#x[0-9a-fA-F]*\)F/\1f/g' \
	-e 's/\(#x[0-9a-fA-F]*\)A/\1a/g' -e 's/\(#x[0-9a-fA-F]*\)B/\1b/g' \
	-e 's/\(#x[0-9a-fA-F]*\)C/\1c/g' -e 's/\(#x[0-9a-fA-F]*\)D/\1d/g' \
	-e 's/\(#x[0-9a-fA-F]*\)E/\1e/g' -e 's/\(#x[0-9a-fA-F]*\)F/\1f/g' \
	-e 's/\(#x[0-9a-fA-F]*\)A/\1a/g' -e 's/\(#x[0-9a-fA-F]*\)B/\1b/g' \
	-e 's/\(#x[0-9a-fA-F]*\)C/\1c/g' -e 's/\(#x[0-9a-fA-F]*\)D/\1d/g' \
	-e 's/\(#x[0-9a-fA-F]*\)E/\1e/g' -e 's/\(#x[0-9a-fA-F]*\)F/\1f/g' \
	<$< >$@

clean:
	rm *keys.dsl

## End of Makefile


Most of the bulk is in downcasing the hex numbers - easier in Perl.
The files header.dsl and footer.dsl add a standard DSSSL wrapping,
including a CDATA marked section, as follows

  <?xml version="1.0" encoding="ISO-8859-1" rmd="none" ?>
  <!DOCTYPE STYLE-SHEET SYSTEM "style-sheet-xml.dtd">

  <STYLE-SHEET>
    <STYLE-SPECIFICATION ID="collate-data" PARTIAL="PARTIAL">
      <STYLE-SPECIFICATION-BODY>
  <![CDATA[
  (define sorttable
    (

;;; generated stuff goes here

     ))
  ]]>
      </STYLE-SPECIFICATION-BODY>
    </STYLE-SPECIFICATION>

  </STYLE-SHEET>


The sed code in the rules for sorttable.dsl comments out the
characters I'm not using, for speed.  To customise for your own use,
change the regexps; at the moment I comment out everything except
0000-00FF and 0174-0177.

The DSSSL code which uses this is still under test.

Source for basekeys.txt and compkeys.txt:

<URL:http://www.unicode.org/unicode/reports/tr10/>

-- 


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Re: Sorted indexes and (string<?) in Jade, (continued)
      • Toby Speight - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id GAA23924Tue, 15 Sep 1998 06:56:37 -0400 (EDT)
        • Matthias Clasen - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id HAA24258Tue, 15 Sep 1998 07:15:03 -0400 (EDT)
    • Matthias Clasen - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id HAA24498Tue, 15 Sep 1998 07:25:09 -0400 (EDT)
      • Steve Tinney - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA28239Tue, 15 Sep 1998 10:03:53 -0400 (EDT)
        • Toby Speight - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA01725Tue, 15 Sep 1998 10:41:45 -0400 (EDT) <=
        • Toby Speight - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id GAA14264Wed, 16 Sep 1998 06:29:11 -0400 (EDT)
    • Thomas Corte - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id HAA27043Sun, 27 Sep 1998 07:30:30 -0400 (EDT)
      • Norman Walsh - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA29921Sun, 27 Sep 1998 10:38:46 -0400 (EDT)
    • Avi Kivity - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA00525Sun, 27 Sep 1998 10:59:03 -0400 (EDT)