Package nltk :: Package draw :: Module chart :: Class ChartDemo
[hide private]
[frames] | no frames]

Class ChartDemo

source code

object --+
         |
        ChartDemo

Instance Methods [hide private]
 
__init__(self, grammar, tokens, title='Chart Parsing Demo')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
destroy(self, *args) source code
 
mainloop(self, *args, **kwargs)
Enter the Tkinter mainloop.
source code
 
_init_parser(self, grammar, tokens) source code
 
_init_fonts(self, root) source code
 
_init_animation(self) source code
 
_init_chartview(self, parent) source code
 
_init_rulelabel(self, parent) source code
 
_init_buttons(self, parent) source code
 
_init_bindings(self) source code
 
_init_menubar(self) source code
 
_click_cv_edge(self, edge) source code
 
_select_matrix_edge(self, edge) source code
 
_select_edge(self, edge) source code
 
_deselect_edge(self) source code
 
_show_new_edge(self, edge) source code
 
help(self, *e) source code
 
about(self, *e) source code
 
load_chart(self, *args)
Load a chart from a pickle file
source code
 
save_chart(self, *args)
Save a chart to a pickle file
source code
 
load_grammar(self, *args)
Load a grammar from a pickle file
source code
 
save_grammar(self, *args) source code
 
reset(self, *args) source code
 
edit_grammar(self, *e) source code
 
set_grammar(self, grammar) source code
 
edit_sentence(self, *e) source code
 
set_sentence(self, sentence) source code
 
view_matrix(self, *e) source code
 
view_results(self, *e) source code
 
resize(self) source code
 
set_font_size(self, size) source code
 
get_font_size(self) source code
 
apply_strategy(self, strategy, edge_strategy=None) source code
 
_stop_animation(self, *e) source code
 
_animate_strategy(self, speed=1) source code
 
_apply_strategy(self) source code
 
_display_rule(self, rule) source code
 
top_down_init(self, *e) source code
 
top_down_expand(self, *e) source code
 
top_down_match(self, *e) source code
 
bottom_up_init(self, *e) source code
 
bottom_up(self, *e) source code
 
fundamental(self, *e) source code
 
bottom_up_strategy(self, *e) source code
 
top_down_strategy(self, *e) source code
 
earley_algorithm(self, *e) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  CHART_FILE_TYPES = [('Pickle file', '.pickle'), ('All files', ...
  GRAMMAR_FILE_TYPES = [('Plaintext grammar file', '.cfg'), ('Pi...
  _TD_INIT = [TopDownInitRule()]
  _TD_EXPAND = [TopDownExpandRule()]
  _TD_MATCH = [TopDownMatchRule()]
  _BU_INIT = [BottomUpInitRule()]
  _BU_RULE = [BottomUpPredictRule()]
  _FUNDAMENTAL = [SingleEdgeFundamentalRule()]
  _EARLEY_INIT = [PseudoEarleyInitRule()]
  _TD_STRATEGY = _TD_INIT+ _TD_EXPAND+ _TD_MATCH+ _FUNDAMENTAL
  _BU_STRATEGY = _BU_INIT+ _BU_RULE+ _FUNDAMENTAL
  _EARLEY = _EARLEY_INIT+ _EARLEY
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, grammar, tokens, title='Chart Parsing Demo')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

mainloop(self, *args, **kwargs)

source code 

Enter the Tkinter mainloop. This function must be called if this demo is created from a non-interactive program (e.g. from a secript); otherwise, the demo will close as soon as the script completes.


Class Variable Details [hide private]

CHART_FILE_TYPES

Value:
[('Pickle file', '.pickle'), ('All files', '*')]

GRAMMAR_FILE_TYPES

Value:
[('Plaintext grammar file', '.cfg'),
 ('Pickle file', '.pickle'),
 ('All files', '*')]