class documentation

class BoxerOutputDrsParser(DrtParser): (source)

Constructor: BoxerOutputDrsParser(discourse_id)

View In Hierarchy

Undocumented

Method __init__ This class is used to parse the Prolog DRS output from Boxer into a hierarchy of python objects.
Method attempt_adjuncts Undocumented
Method get_all_symbols This method exists to be overridden
Method handle This method is intended to be overridden for logics that use different operators or expressions
Method handle_condition Handle a DRS condition
Method handle_drs Undocumented
Method parse Parse the expression.
Method parse_condition Parse a DRS condition
Method parse_drs Undocumented
Method parse_index Undocumented
Method parse_variable Undocumented
Instance Variable discourse_id Undocumented
Instance Variable quote_chars Undocumented
Instance Variable sentence_id_offset Undocumented
Method _handle_alfa Undocumented
Method _handle_binary_expression Undocumented
Method _handle_card Undocumented
Method _handle_date Undocumented
Method _handle_duplex Undocumented
Method _handle_eq Undocumented
Method _handle_named Undocumented
Method _handle_not Undocumented
Method _handle_pred Undocumented
Method _handle_prop Undocumented
Method _handle_rel Undocumented
Method _handle_time Undocumented
Method _handle_time_expression Undocumented
Method _handle_timex Undocumented
Method _handle_whq Undocumented
Method _make_imp_expression Undocumented
Method _make_merge_expression Undocumented
Method _make_or_expression Undocumented
Method _parse_index_list Undocumented
Method _sent_and_word_indices No summary

Inherited from DrtParser:

Method get_BooleanExpression_factory This method serves as a hook for other logic parsers that have different boolean operators
Method handle_conds Undocumented
Method handle_DRS Undocumented
Method handle_prop Undocumented
Method handle_refs Undocumented
Method isvariable Undocumented
Method make_ApplicationExpression Undocumented
Method make_BooleanExpression Undocumented
Method make_EqualityExpression This method serves as a hook for other logic parsers that have different equality expression classes
Method make_LambdaExpression Undocumented
Method make_NegatedExpression Undocumented
Method make_VariableExpression Undocumented
Instance Variable operator_precedence Undocumented

Inherited from LogicParser (via DrtParser):

Method __repr__ Undocumented
Method assertNextToken Undocumented
Method assertToken Undocumented
Method attempt_ApplicationExpression Attempt to make an application expression. The next tokens are a list of arguments in parens, then the argument expression is a function being applied to the arguments. Otherwise, return the argument expression.
Method attempt_BooleanExpression Attempt to make a boolean expression. If the next token is a boolean operator, then a BooleanExpression will be returned. Otherwise, the parameter will be returned.
Method attempt_EqualityExpression Attempt to make an equality expression. If the next token is an equality operator, then an EqualityExpression will be returned. Otherwise, the parameter will be returned.
Method get_next_token_variable Undocumented
Method get_QuantifiedExpression_factory This method serves as a hook for other logic parsers that have different quantifiers
Method handle_lambda Undocumented
Method handle_negation Undocumented
Method handle_open Undocumented
Method handle_quant Undocumented
Method handle_variable Undocumented
Method has_priority Undocumented
Method inRange Return TRUE if the given location is within the buffer
Method make_QuanifiedExpression Undocumented
Method process Split the data into tokens
Method process_next_expression Parse the next complete expression from the stream and return it.
Method process_quoted_token Undocumented
Method token Get the next waiting token. If a location is given, then return the token at currentIndex+location without advancing currentIndex; setting it gives lookahead/lookback capability.
Instance Variable right_associated_operations Undocumented
Instance Variable type_check A list of tuples of quote characters. The 4-tuple is comprised of the start character, the end character, the escape character, and a boolean indicating whether the quotes should be included in the result...
Instance Variable _buffer Undocumented
Instance Variable _currentIndex Undocumented
def __init__(self, discourse_id=None): (source)

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

def attempt_adjuncts(self, expression, context): (source)
def get_all_symbols(self): (source)

This method exists to be overridden

def handle(self, tok, context): (source)

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

def handle_condition(self, tok, indices): (source)

Handle a DRS condition

Parameters
tokUndocumented
indiceslist of int
Returns
list of DrtExpression
def handle_drs(self, tok): (source)

Undocumented

def parse(self, data, signature=None): (source)

Parse the expression.

strings :returns: a parsed Expression

Parameters
datastr for the input to be parsed
signaturedict<str, str> that maps variable names to type
def parse_condition(self, indices): (source)

Parse a DRS condition

Returns
list of DrtExpression
def parse_drs(self): (source)

Undocumented

def parse_index(self): (source)

Undocumented

def parse_variable(self): (source)

Undocumented

discourse_id = (source)

Undocumented

quote_chars: list[tuple] = (source)
sentence_id_offset = (source)

Undocumented

def _handle_alfa(self, make_callback): (source)

Undocumented

def _handle_binary_expression(self, make_callback): (source)

Undocumented

def _handle_card(self): (source)

Undocumented

def _handle_date(self, arg): (source)

Undocumented

def _handle_duplex(self): (source)

Undocumented

def _handle_eq(self): (source)

Undocumented

def _handle_named(self): (source)

Undocumented

def _handle_not(self): (source)

Undocumented

def _handle_pred(self): (source)

Undocumented

def _handle_prop(self): (source)

Undocumented

def _handle_rel(self): (source)

Undocumented

def _handle_time(self, arg): (source)

Undocumented

def _handle_time_expression(self, arg): (source)

Undocumented

def _handle_timex(self): (source)

Undocumented

def _handle_whq(self): (source)

Undocumented

def _make_imp_expression(self, sent_index, word_indices, drs1, drs2): (source)

Undocumented

def _make_merge_expression(self, sent_index, word_indices, drs1, drs2): (source)

Undocumented

def _make_or_expression(self, sent_index, word_indices, drs1, drs2): (source)

Undocumented

def _parse_index_list(self): (source)

Undocumented

def _sent_and_word_indices(self, indices): (source)
Returns
list of (sent_index, word_indices) tuples