joshua-decoder/joshua — pull request #58 by jweese (2012-10-24 15:27:32+00:00)
Title: Fix tree visualizer

Just in time for AMTA!

This series of commits does three things:

1) clean up and removed old/unused code

The old code was not well-designed. For example, the main class had a lot of public globals that were accessed from all over. Also, there was no clean separation between (a) reading in the data, (b) the internal representation of it, and (c) rendering and displaying the trees. These three pieces have been separated more cleanly.

2) fix a longstanding bug in tree rendering

I completely rewrote the code for converting the internal representation into a displayable graph, and the one bug that was reported to me by email has been fixed.

3) add search functionality

The main window contains a text box that works kind of like a poor man's ctrl+f in the browser: as you type, it jumps to the next sentence that contains whatever's in the search box

4) add a script for launching the visualizer

A simple bash script.

CAVEATS:

The target side of derivations renders one leaf node per terminal symbol, and it might look cleaner is sibling leaves were combined into one "phrase leaf". For example, in "(A foo bar (B baz))", foo and bar are rendered in separate leaves, but they could be combined.

The other caveat is, just try it to make sure there are no surprises.

Thanks!

Jonny.