Type SymbolWidget
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:
-
color: the color of the text.
-
draggable: whether the text can be dragged by the
user.
| Method Summary |
| |
__init__(self,
canvas,
symbol,
**attribs)
Create a new symbol widget. |
string
|
__repr__(self)
Return a string representation of this canvas widget. |
| |
set_symbol(self,
symbol)
Change the symbol that is displayed by this symbol widget. |
string
|
symbol(self)
Return the name of the symbol that is displayed by this symbol widget. |
| |
symbolsheet(size)
Open a new Tkinter window that displays the entire alphabet for the
symbol font. (Static method)
|
Inherited from TextWidget:
__getitem__,
__setitem__,
set_text,
text,
_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,
_add_child_widget,
_manage,
_remove_child_widget,
_update
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__str__
|
| Class Variable Summary |
dict |
SYMBOLS: A dictionary mapping from symbols to the character in the
symbol font used to render them. |
__init__(self,
canvas,
symbol,
**attribs)
(Constructor)
Create a new symbol widget.
-
- Parameters:
canvas -
This canvas widget's canvas.
(type=Tkinter.Canvas)
symbol -
The name of the symbol to display.
(type=string)
attribs -
The new canvas widget's attributes.
- Overrides:
nltk_lite.draw.TextWidget.__init__
|
__repr__(self)
(Representation operator)
-
- Returns:
-
a string representation of this canvas widget.
(type=string)
- Overrides:
nltk_lite.draw.TextWidget.__repr__ (inherited documentation)
|
set_symbol(self,
symbol)
Change the symbol that is displayed by this symbol widget.
-
- Parameters:
symbol -
The name of the symbol to display.
(type=string)
|
symbol(self)
-
- Returns:
-
the name of the symbol that is displayed by this symbol
widget.
(type=string)
|
symbolsheet(size=20)
Open a new Tkinter window that displays the entire alphabet for the
symbol font. This is useful for constructing the SymbolWidget.SYMBOLS dictionary.
-
|
SYMBOLS
A dictionary mapping from symbols to the character in the
symbol font used to render them.
-
- Type:
-
dict
- Value:
{'conj': '\xd9',
'disj': '\xda',
'emptyset': '\xc6',
'epsilon': 'e',
'equal': '=',
'exists': '$',
'forall': '"',
'imp': '\xde',
...
|
|