Package jazzparser :: Package parsers
[hide private]
[frames] | no frames]

Source Code for Package jazzparser.parsers

 1  """Parser modules for the Jazz Parser. 
 2   
 3  Subpackages of this define parser modules. Each may implement its own  
 4  parsing algorithm and operates independently of the formalism and  
 5  tagger, which have strictly defined interfaces through which the parser  
 6  accesses them. 
 7   
 8  To add a new parser, create the parser class in a new subpackage and  
 9  add the package's name to the PARSERS constant below. 
10   
11  """ 
12  """ 
13  ============================== License ======================================== 
14   Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding 
15    
16   This file is part of The Jazz Parser. 
17    
18   The Jazz Parser is free software: you can redistribute it and/or modify 
19   it under the terms of the GNU General Public License as published by 
20   the Free Software Foundation, either version 3 of the License, or 
21   (at your option) any later version. 
22    
23   The Jazz Parser is distributed in the hope that it will be useful, 
24   but WITHOUT ANY WARRANTY; without even the implied warranty of 
25   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
26   GNU General Public License for more details. 
27    
28   You should have received a copy of the GNU General Public License 
29   along with The Jazz Parser.  If not, see <http://www.gnu.org/licenses/>. 
30   
31  ============================ End license ====================================== 
32   
33  """ 
34  __author__ = "Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>"  
35   
36   
37  PARSERS = [ 
38      'cky', 
39      'pcfg', 
40      'tagrank', 
41      'fail', 
42  ] 
43   
44 -class RuleApplicationError(Exception):
45 """ 46 Thrown if there's an error during application of a rule to categories. 47 """ 48 pass
49
50 -class ParseError(Exception):
51 """ 52 Thrown if it's not possible to carry out a parse, for some reason. 53 E.g. the word might not be in the morphology. 54 """ 55 pass
56
57 -class ParserInitializationError(Exception):
58 """ 59 Thrown when initializing the parser if something in the 60 configuration prevents correct initialization. 61 """ 62 pass
63