Package nltk :: Package draw :: Class SymbolWidget
[hide private]
[frames] | no frames]

Class SymbolWidget

source code

  object --+        
           |        
CanvasWidget --+    
               |    
      TextWidget --+
                   |
                  SymbolWidget

A canvas widget that displays special symbols, such as the negation sign and the exists operator. Symbols are specified by name. Currently, the following symbol names are defined: neg, disj, conj, lambda, merge, forall, exists, subseteq, subset, notsubset, emptyset, imp, rightarrow, equal, notequal, epsilon.

Attributes:

Instance Methods [hide private]
 
__init__(self, canvas, symbol, **attribs)
Create a new symbol widget.
source code
 
__repr__(self) source code
 
set_symbol(self, symbol)
Change the symbol that is displayed by this symbol widget.
source code
string
symbol(self)
Returns: the name of the symbol that is displayed by this symbol widget.
source code

Inherited from TextWidget: __getitem__, __setitem__, set_text, text

Inherited from TextWidget (private): _tags

Inherited from CanvasWidget: bbox, bind_click, bind_drag, canvas, child_widgets, destroy, height, hidden, hide, manage, move, moveto, parent, show, tags, unbind_click, unbind_drag, update, width

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

Static Methods [hide private]
 
symbolsheet(size=20)
Open a new Tkinter window that displays the entire alphabet for the symbol font.
source code
Class Variables [hide private]
  SYMBOLS = {'conj': '\xd9', 'disj': '\xda', 'emptyset': '\xc6',...
A dictionary mapping from symbols to the character in the symbol font used to render them.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, canvas, symbol, **attribs)
(Constructor)

source code 

Create a new symbol widget.

Parameters:
  • canvas (Tkinter.Canvas) - This canvas widget's canvas.
  • symbol (string) - The name of the symbol to display.
  • attribs - The new canvas widget's attributes.
Overrides: TextWidget.__init__

__repr__(self)
(Representation operator)

source code 
Overrides: TextWidget.__repr__

set_symbol(self, symbol)

source code 

Change the symbol that is displayed by this symbol widget.

Parameters:
  • symbol (string) - The name of the symbol to display.

symbol(self)

source code 
Returns: string
the name of the symbol that is displayed by this symbol widget.

symbolsheet(size=20)
Static Method

source code 

Open a new Tkinter window that displays the entire alphabet for the symbol font. This is useful for constructing the SymbolWidget.SYMBOLS dictionary.


Class Variable Details [hide private]

SYMBOLS

A dictionary mapping from symbols to the character in the symbol font used to render them.
Value:
{'conj': '\xd9',
 'disj': '\xda',
 'emptyset': '\xc6',
 'epsilon': 'e',
 'equal': '=',
 'exists': '$',
 'forall': '"',
 'imp': '\xde',
...