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

Source Code for Package nltk.draw

 1  # Natural Language Toolkit: graphical representations package 
 2  # 
 3  # Copyright (C) 2001-2011 NLTK Project 
 4  # Author: Edward Loper <edloper@gradient.cis.upenn.edu> 
 5  #         Steven Bird <sb@csse.unimelb.edu.au> 
 6  # URL: <http://www.nltk.org/> 
 7  # For license information, see LICENSE.TXT 
 8  # 
 9  # $Id: __init__.py 8730 2011-03-08 04:49:46Z StevenBird1 $ 
10   
11  # Import Tkinter-based modules if Tkinter is installed 
12  try: 
13      import Tkinter 
14  except ImportError: 
15      import warnings 
16      warnings.warn("nltk.draw package not loaded " 
17                    "(please install Tkinter library).") 
18  else: 
19      from cfg import * 
20      from tree import * 
21      from dispersion import dispersion_plot 
22   
23      # Make sure that nltk.draw.cfg and nltk.draw.tree refer to the correct 
24      # modules (and not to nltk.cfg & nltk.tree) 
25      import cfg, tree 
26