ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
Cc: ntg-context@ntg.nl, pdfTeX developers list <ntg-pdftex@ntg.nl>
Subject: TeX trie processing (\pattern loading) details visualisation
Date: Mon, 11 Jul 2005 17:11:52 +0200	[thread overview]
Message-ID: <42D28C38.3000505@elvenkind.com> (raw)
In-Reply-To: <429F265B.3070402@elvenkind.com>


Hi,

Vaguely connected to the font reader visualisation I posted last
month, I have created a visualisation of the trie (\pattern)
processing source code in initex.

There are files here:

    http://tex.aanhet.net/temp/patreader.zip (12.825 bytes)
    http://tex.aanhet.net/temp/patreader.pdf (> 36 Megabytes)

Please fetch the zip file and attempt to generate a local
version yourself before downloading the PDF document :)

The process itself is a bit harder to comprehend than the font
reader, so some background knowledge is needed. It also helps
if you have the TeX pascal sources handy.

I should probably write a descriptive text in prose to go along
with the images, but I'm bored with this stuff. It took me much
longer than I had anticipated, because I kept running into
limitations of MP ;-(


Roughly, the execution order <-> pages mapping is as follows:

   pages      function          action

    1  -   8  new_patterns()    % \patterns for language 0
    9  -  23  new_patterns()    % \patterns for language 2
   24  -  26  new_patterns()    % \patterns for language 1
   27  -  29  init_trie()       % initialization of arrays
   30  -  41  init_trie()       % reshuffling languages 2 and 1
   42  -  42  init_trie()       % prepare for compression
   43  - 241  compress_trie()   % trie compression
  242  - 244  init_trie()       % prepare for packing
  245  - 717  first_fit()       % trie packing
  718  - 965  init_trie()       % finalizations for run-time

The various blue items are used runtime (i.e. during hyphenation),
the other arrays are only used in initex or only for statistics
reporting.

trie_hash is physically the same array as trie_ref, but it is
cleaner to show them separately.

The supplied perl script can in fact demonstrate the hyphenation of
words using TeX's algorithm, but if you want meaningful results you
have to feed it hyphen.tex instead of the three demonstration languages,
and in that case, you have to increase the two limits ($trie_size and
$trie_op_size). Check the top (and bottom) of the perl script for that.

Have fun,

Taco

      parent reply	other threads:[~2005-07-11 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <429D6DD1.2040005@wxs.nl>
     [not found] ` <429D734F.7040203@elvenkind.com>
     [not found]   ` <429D7FB5.90406@wxs.nl>
2005-06-02 15:31     ` [NTG-pdftex] kerning Taco Hoekwater
2005-06-02 20:28       ` Hans Hagen
2005-06-28 12:10       ` kerning Patrick Gundlach
2005-07-11 15:11       ` Taco Hoekwater [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42D28C38.3000505@elvenkind.com \
    --to=taco@elvenkind.com \
    --cc=ntg-context@ntg.nl \
    --cc=ntg-pdftex@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).