__init__.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Natural Language Toolkit: Applications 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. """
  9. Interactive NLTK Applications:
  10. chartparser: Chart Parser
  11. chunkparser: Regular-Expression Chunk Parser
  12. collocations: Find collocations in text
  13. concordance: Part-of-speech concordancer
  14. nemo: Finding (and Replacing) Nemo regular expression tool
  15. rdparser: Recursive Descent Parser
  16. srparser: Shift-Reduce Parser
  17. wordnet: WordNet Browser
  18. """
  19. # Import Tkinter-based modules if Tkinter is installed
  20. try:
  21. import tkinter
  22. except ImportError:
  23. import warnings
  24. warnings.warn("nltk.app package not loaded " "(please install Tkinter library).")
  25. else:
  26. from nltk.app.chartparser_app import app as chartparser
  27. from nltk.app.chunkparser_app import app as chunkparser
  28. from nltk.app.collocations_app import app as collocations
  29. from nltk.app.concordance_app import app as concordance
  30. from nltk.app.nemo_app import app as nemo
  31. from nltk.app.rdparser_app import app as rdparser
  32. from nltk.app.srparser_app import app as srparser
  33. from nltk.app.wordnet_app import app as wordnet
  34. try:
  35. from matplotlib import pylab
  36. except ImportError:
  37. import warnings
  38. warnings.warn(
  39. "nltk.app.wordfreq not loaded " "(requires the matplotlib library)."
  40. )
  41. else:
  42. from nltk.app.wordfreq_app import app as wordfreq
  43. # skip doctests from this package
  44. def setup_module(module):
  45. from nose import SkipTest
  46. raise SkipTest("nltk.app examples are not doctests")