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

Source Code for Package nltk.app

 1  # Natural Language Toolkit: Applications 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 7460 2009-01-29 01:06:02Z StevenBird1 $ 
10   
11  """ 
12  Interactive NLTK Applications: 
13   
14  chartparser:  Chart Parser 
15  chunkparser:  Regular-Expression Chunk Parser 
16  collocations: Find collocations in text 
17  concordance:  Part-of-speech concordancer 
18  nemo:         Finding (and Replacing) Nemo regular expression tool 
19  rdparser:     Recursive Descent Parser 
20  srparser:     Shift-Reduce Parser 
21  wordnet:      WordNet Browser 
22  """ 
23   
24   
25  # Import Tkinter-based modules if Tkinter is installed 
26  try: 
27      import Tkinter 
28  except ImportError: 
29      import warnings 
30      warnings.warn("nltk.app package not loaded " 
31                    "(please install Tkinter library).") 
32  else: 
33      from chartparser_app import app as chartparser 
34      from chunkparser_app import app as chunkparser 
35      from collocations_app import app as collocations 
36      from concordance_app import app as concordance 
37      from nemo_app import app as nemo 
38      from rdparser_app import app as rdparser 
39      from srparser_app import app as srparser 
40      from wordnet_app import app as wordnet 
41   
42      try: 
43          import pylab 
44      except ImportError: 
45          import warnings 
46          warnings.warn("nltk.app.wordfreq not loaded " 
47                        "(requires the pylab library).") 
48      else: 
49          from wordfreq_app import app as wordfreq 
50   
51  # Import wx-based modules if wx is installed 
52  try: 
53      import wx 
54  except ImportError: 
55      pass  # fail silently 
56  else: 
57      try: 
58          from wxwordnet_app import app as wxwordnet 
59      except ImportError: 
60          pass # fail silently -- but this is BROKEN! 
61