Package jazzparser :: Package parsers :: Package cky :: Module inspector
[hide private]
[frames] | no frames]

Module inspector

source code

Chart inspector, for viewing the chart during parsing.

A graphical interface to observe the state of a chart during parsing. A chart inspector runs alongside the parser in a separate thread and updates its representation of the chart from the actual one being manipulated by the parser whenever the user asks for an update.

The inspector shows the number of signs in each cell of the chart and allows inspection of what those signs are and even the derivation trace (if available) for each one.

Note that this module uses PyGtk, which is not required for most of the project. You should not import anything from this module at the top level, but only when you need it. That way, if PyGtk is not installed, an error will only occur when you try to use it.

You can also read a pickled chart in from a file and use the chart inspector to examine it.


Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>

Classes [hide private]
  CellInspectorWindow
A small window that gives more information about a particular cell in the chart.
  ChartInspectorWindow
A window that displays a summary of the chart and allows inspection of it in greater detail.
  DerivationTraceWindow
Simple window to spew out a derivation trace for a sign in the chart.
  ChartInspectorThread
A thread to display a window at the same time as parsing is going on.
Functions [hide private]
 
inspect_chart_file(filename, inspector_cls=None)
Load a pickled chart from a file and display the chart inspector to examine it.
source code
Variables [hide private]
  LAST_UPDATE_COLOR = '#f0d0d0'
  __package__ = 'jazzparser.parsers.cky'
Function Details [hide private]

inspect_chart_file(filename, inspector_cls=None)

source code 

Load a pickled chart from a file and display the chart inspector to examine it.

Parameters:
  • filename (string) - the filename of the file to load
  • inspector_cls (class) - the class of the inspector window to load the chart in. By default, uses the CKY inspector, but you may want to use subclasses.