Package nltk :: Package sem :: Module boxer :: Class BoxerOutputDrsParser
[hide private]
[frames] | no frames]

type BoxerOutputDrsParser

source code

       object --+        
                |        
logic.LogicParser --+    
                    |    
        drt.DrtParser --+
                        |
                       BoxerOutputDrsParser

Instance Methods [hide private]
 
__init__(self, discourse_id=None)
This class is used to parse the Prolog DRS output from Boxer into a hierarchy of python objects.
source code
 
parse(self, data, signature=None)
Parse the expression.
source code
 
get_all_symbols(self)
This method exists to be overridden
source code
 
handle(self, tok, context)
This method is intended to be overridden for logics that use different operators or expressions
source code
 
attempt_adjuncts(self, expression, context) source code
 
parse_condition(self, indices)
Parse a DRS condition
source code
 
handle_drs(self, tok) source code
 
handle_condition(self, tok, indices)
Handle a DRS condition
source code
 
_handle_not(self) source code
 
_handle_pred(self) source code
 
_handle_named(self) source code
 
_handle_rel(self) source code
 
_handle_timex(self) source code
 
_handle_time_expression(self, arg) source code
 
_handle_date(self, arg) source code
 
_handle_time(self, arg) source code
 
_handle_card(self) source code
 
_handle_prop(self) source code
 
_parse_index_list(self) source code
 
parse_drs(self) source code
 
_handle_binary_expression(self, make_callback) source code
 
_handle_eq(self) source code
 
_handle_whq(self) source code
 
_make_merge_expression(self, sent_index, word_indices, drs1, drs2) source code
 
_make_or_expression(self, sent_index, word_indices, drs1, drs2) source code
 
_make_imp_expression(self, sent_index, word_indices, drs1, drs2) source code
 
parse_variable(self) source code
 
parse_index(self) source code
 
_sent_and_word_indices(self, indices)
Returns: list of (sent_index, word_indices) tuples
source code

Inherited from drt.DrtParser: get_BooleanExpression_factory, handle_DRS, handle_conds, handle_refs, isvariable, make_ApplicationExpression, make_BooleanExpression, make_EqualityExpression, make_LambdaExpression, make_NegatedExpression, make_VariableExpression

Inherited from logic.LogicParser: __repr__, assertNextToken, assertToken, attempt_ApplicationExpression, attempt_BooleanExpression, attempt_EqualityExpression, ensure_abstractable, get_QuantifiedExpression_factory, get_next_token_variable, handle_lambda, handle_negation, handle_open, handle_quant, handle_variable, has_priority, inRange, make_QuanifiedExpression, parse_Expression, process, process_quoted_token, token

Instance Variables [hide private]

Inherited from logic.LogicParser: type_check

Method Details [hide private]

__init__(self, discourse_id=None)
(Constructor)

source code 

This class is used to parse the Prolog DRS output from Boxer into a hierarchy of python objects.

Parameters:
  • type_check - boolean should type checking be performed? to their types.
Overrides: logic.LogicParser.__init__

parse(self, data, signature=None)

source code 

Parse the expression.

Parameters:
  • data - str for the input to be parsed
  • signature - dict<str, str> that maps variable names to type strings
Returns:
a parsed Expression
Overrides: logic.LogicParser.parse
(inherited documentation)

get_all_symbols(self)

source code 

This method exists to be overridden

Overrides: logic.LogicParser.get_all_symbols
(inherited documentation)

handle(self, tok, context)

source code 

This method is intended to be overridden for logics that use different operators or expressions

Overrides: logic.LogicParser.handle
(inherited documentation)

attempt_adjuncts(self, expression, context)

source code 
Overrides: logic.LogicParser.attempt_adjuncts

parse_condition(self, indices)

source code 

Parse a DRS condition

Returns:
list of AbstractDrs

handle_condition(self, tok, indices)

source code 

Handle a DRS condition

Parameters:
  • indices - list of int
Returns:
list of AbstractDrs

_sent_and_word_indices(self, indices)

source code 
Returns:
list of (sent_index, word_indices) tuples