The set of files described here implements two methods of displaying syntactic 
parse trees.  All code is provided without any warranties, express or implied, 
yada, yada, yada.  This code is free, but it is not in the public domain; it 
is copyright (c) MIT.  You may use it for non-profit purposes and give it away 
provided this notice is maintained, etc., etc., etc.  (You know the routine.)

If you have any questions about this code, feel free to contact me at 
sfelshin@mit.edu.  If I have time, I might even answer.  I meant to clean 
the code up a bit before posting it to the net, but I didn't have time.  
Sorry.  Good luck with it, folks.

Sue Felshin
MIT Laboratory for Advanced Technology in the Humanities
(formerly the MIT Athena Language Learning Project)


Provided are:

1) This README file.

2) "Pnode" (Print NODE)

A cheesy but cheap text-only tree indenter which requires no extensions to 
first edition Common Lisp.  It was designed for formatting natural language 
parse trees.  But about all it does is smart breaking of long lines, e.g., 
(s (np (det The) (noun cat)) (vp (verb chased) (np (det the) (noun mouse)))) 
=>

(s (np (det The) (noun cat))
   (vp (verb chased)
       (np (det the) (noun mouse))))

It is, admittedly, only barely different from pretty printing, but has 
primitive facilities for printing subscripts and a few other properties.  
The expected input is a tree of particular structs that implement nodes 
and leaves in a parse tree, but the code can easily be adapted to accept 
different input.

This code may be found in the file pnode.lisp.

3) "Gnode" (Graph NODE)

Macintosh Common Lisp code that draw parse trees in two dimensions, each tree 
in its own window.  The code is entirely in lisp, but uses MCL extensions to 
Common Lisp to create windows and draw graphics in them, e.g., as below but 
with _real_graphics_ and in a real window, not as ASCII art. The code supports 
all sorts of nifty features like sub- and superscripts at left and right, 
boldface and italics, different line shapes, weights, and fills, arbitrary 
connections between nodes, and more.

  =[]========The cat chased the mouse============
  |                                             |
  |                  s                          |
  |                 / \                         |
  |               /     \                       |
  |             /         \                     |
  |           np           vp                   |
  |         /   \         /   \                 |
  |       /      \       /      \               |
  |      det    noun    verb     np             |
  |      |       |       |       |  \           |
  |     The     cat    chased    |    \         |
  |                             det   noun      |
  |                              |      |       |
  |                             the   mouse     |
  |                                             |
  |_____________________________________________|

Low-level code is defined to take input in its own command language; 
high-level code translates parse trees and other related structures into 
the command language for display but can be adapted to accept different input.  
Input can be constructed directly in the command language (convenient for 
creating trees to be included in documents, but see below about PostScript), 
or you can write your own high-level code to convert your structures to the 
command language.

The expected input is a tree of particular structs that implement nodes 
and leaves in a parse tree, but the code   In addition, the 

Low-level code for this module was originally written in version 10 of X.  
In that incarnation, it included a module to save displayed trees as 
PostScript, which was great for creating spiffy-looking trees to include in 
documents; anyone interested in this code should send me mail and I'll post it 
when I get a chance.  (If you're planning to convert it to something that will 
run on the Mac, and promise to give me any code you write, I'll have more 
incentive to hurry up and unearth that code, post it, and answer questions 
about it ;-) .)

Included files are:

gnode-command-language.text
   Describes the command language accepted by low-level code.

example-cl-input.text
   Example file of input in command language.  Describes a non-sensical tree 
   structure that shows off all features of the tree printer.

example-cl-output.eps
   Encapsulated PostScript file of output produced by processing 
   example-cl-input.text.  (This file was produced ages ago when we could 
   still run the X version of the code.)

mac-gnode.lisp
   Implements creation of MCL windows and display of trees in them.  If 
   memory serves me (unlikely), there is a minor bug somewhere in this code 
   such that a single child is sometimes incorrectly displayed with a 
   non-vertical line connecting it to its parent.

gnode-tools.lisp
   Processes commands in the command language.  In MCL, creates MCL 
   windows and passes the processed commands to the windows.  References 
   one file not provided here, feat-support.lisp, in order to call 
   a function DESCRIBE-FEATURES, which formats a bit-vector of "features" 
   as a list of feature names.  DESCRIBE-FEATURES can be mininally 
   implemented as (defun describe-features (arg stream &rest ignore) (princ 
   arg stream)).

   Please note that the main function in this file, GNODE-COMMAND, implements 
   most but NOT all of the commands described in the file 
   gnode-command-language.text; some more esoteric commands are omitted.  I 
   never got around to implementing them, drat.  (If you implement them, you 
   could send me the code, hint, hint... :-) )

gnode-support.lisp
   Provides support for processing properties of parse-tree structures such as 
   coindexing.

gnode.lisp, gcf.lisp, gref.lisp
   Process parse tree, case frame, and interlingua structures, respectively, 
   into the gnode command language, and call low-level code to display them.  
   These files are provided primarily as examples of using the low-level code.

Files which are NOT included are a fair number of files related to the 
structures which the high-level files take as input.  It is assumed that 
people using this code will want to adapt it to process their own structures.
