concepts.language.ccg.composition.CCGCompositionContext#
- class CCGCompositionContext[source]#
Bases:
OptionContext
An option context for CCG composition.
Methods
Make this option context the current context.
exc
([exc_type, from_])Context manager for handling composition errors.
Get the current option context.
get_option
(name)Get the option value of the current context.
set_default_option
(name, value)Set the option value for the current context.
Attributes
Whether to perform syntax composition.
Whether to perform semantics composition.
Whether to perform lazy semantics composition.
Whether to raise verbose exceptions.
- __init__(**init_kwargs)#
- __new__(**kwargs)#
- as_default()#
Make this option context the current context. It will overwrite the current option values.
- exc(exc_type=None, from_=None)[source]#
Context manager for handling composition errors. If exc_verbose is True, the error will be printed out.
Example
>>> with get_ccg_composition_context().exc(): >>> raise CCGCompositionError('some error')
- classmethod get_default()#
Get the current option context.
- classmethod get_option(name)#
Get the option value of the current context.
- classmethod set_default_option(name, value)#
Set the option value for the current context.