Last summer, I made a bare-bones syntax tree application entirely in javascript, which I’m calling the Larch Tree Drawer, after the Monty Python sketch. The software:
- Is written entirely in JavaScript, so it can do fast real-time updating.
- Creates a png image which can be easily copied elsewhere.
- Uses efficiently spaced trees (see [1])
- Automatically closes brackets.
- Automatically opens brackets (triggered by an ALL-CAPS node label)
Check it out and let me know any bugs and/or feature requests. I’m considering an option to output qtree-style latex code, but I haven’t implemented it yet. Also, I know that the dimensions of the png files are a little too large right now.
Using the default options can feel a little weird, but you’ll soon see how fast it can be to input standard trees. For instance, type “S NP” and you’ll see:
Then, add “John] VP” to get:
Round it out with “V loves] NP Semantics” to get:
And you only needed two brackets!
[1] An algorithm from http://billmill.org/pymag-trees/ based on:
Buchheim, Christoph, Michael Jünger, and Sebastian Leipert. “Improving Walker’s algorithm to run in linear time.” Graph Drawing. Springer Berlin Heidelberg, 2002.
Walker, John Q. “A node‐positioning algorithm for general trees.” Software: Practice and Experience 20.7 (1990): 685-705.
Looks nice! It would be great if the code were up on someplace like GitHub so folks can collaborate on it.
Three missing features that come immediately to mind: (i) the ability to draw triangles; (ii) the ability to draw movement arrows; and (iii) the ability to draw traces and indexes (i.e., subscripts). That being said, this is a pretty cool, tool, though, Ezra!
Thanks, guys. I have wanted to look into GitHub anyways, so maybe I’ll post this there soon. And thanks for the suggestions, Adam!
Pingback: GitHub Linguistics | Semantic Disposition