__init__.py 931 B

123456789101112131415161718192021222324252627282930313233
  1. # Natural Language Toolkit: graphical representations package
  2. #
  3. # Copyright (C) 2001-2020 NLTK Project
  4. # Author: Edward Loper <edloper@gmail.com>
  5. # Steven Bird <stevenbird1@gmail.com>
  6. # URL: <http://nltk.org/>
  7. # For license information, see LICENSE.TXT
  8. # Import Tkinter-based modules if Tkinter is installed
  9. try:
  10. import tkinter
  11. except ImportError:
  12. import warnings
  13. warnings.warn("nltk.draw package not loaded " "(please install Tkinter library).")
  14. else:
  15. from nltk.draw.cfg import ProductionList, CFGEditor, CFGDemo
  16. from nltk.draw.tree import (
  17. TreeSegmentWidget,
  18. tree_to_treesegment,
  19. TreeWidget,
  20. TreeView,
  21. draw_trees,
  22. )
  23. from nltk.draw.table import Table
  24. from nltk.draw.dispersion import dispersion_plot
  25. # skip doctests from this package
  26. def setup_module(module):
  27. from nose import SkipTest
  28. raise SkipTest("nltk.draw examples are not doctests")