# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.1.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _constraint_grammar
else:
    import _constraint_grammar

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _constraint_grammar.delete_SwigPyIterator

    def value(self):
        return _constraint_grammar.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _constraint_grammar.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _constraint_grammar.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _constraint_grammar.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _constraint_grammar.SwigPyIterator_equal(self, x)

    def copy(self):
        return _constraint_grammar.SwigPyIterator_copy(self)

    def next(self):
        return _constraint_grammar.SwigPyIterator_next(self)

    def __next__(self):
        return _constraint_grammar.SwigPyIterator___next__(self)

    def previous(self):
        return _constraint_grammar.SwigPyIterator_previous(self)

    def advance(self, n):
        return _constraint_grammar.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _constraint_grammar.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _constraint_grammar.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _constraint_grammar.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _constraint_grammar.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _constraint_grammar.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _constraint_grammar.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _constraint_grammar:
_constraint_grammar.SwigPyIterator_swigregister(SwigPyIterator)
class Grammar(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    ux_stderr = property(_constraint_grammar.Grammar_ux_stderr_get, _constraint_grammar.Grammar_ux_stderr_set)
    ux_stdout = property(_constraint_grammar.Grammar_ux_stdout_get, _constraint_grammar.Grammar_ux_stdout_set)
    has_dep = property(_constraint_grammar.Grammar_has_dep_get, _constraint_grammar.Grammar_has_dep_set)
    has_bag_of_tags = property(_constraint_grammar.Grammar_has_bag_of_tags_get, _constraint_grammar.Grammar_has_bag_of_tags_set)
    has_relations = property(_constraint_grammar.Grammar_has_relations_get, _constraint_grammar.Grammar_has_relations_set)
    has_encl_final = property(_constraint_grammar.Grammar_has_encl_final_get, _constraint_grammar.Grammar_has_encl_final_set)
    has_protect = property(_constraint_grammar.Grammar_has_protect_get, _constraint_grammar.Grammar_has_protect_set)
    is_binary = property(_constraint_grammar.Grammar_is_binary_get, _constraint_grammar.Grammar_is_binary_set)
    sub_readings_ltr = property(_constraint_grammar.Grammar_sub_readings_ltr_get, _constraint_grammar.Grammar_sub_readings_ltr_set)
    ordered = property(_constraint_grammar.Grammar_ordered_get, _constraint_grammar.Grammar_ordered_set)
    addcohort_attach = property(_constraint_grammar.Grammar_addcohort_attach_get, _constraint_grammar.Grammar_addcohort_attach_set)
    grammar_size = property(_constraint_grammar.Grammar_grammar_size_get, _constraint_grammar.Grammar_grammar_size_set)
    num_tags = property(_constraint_grammar.Grammar_num_tags_get, _constraint_grammar.Grammar_num_tags_set)
    mapping_prefix = property(_constraint_grammar.Grammar_mapping_prefix_get, _constraint_grammar.Grammar_mapping_prefix_set)
    lines = property(_constraint_grammar.Grammar_lines_get, _constraint_grammar.Grammar_lines_set)
    verbosity_level = property(_constraint_grammar.Grammar_verbosity_level_get, _constraint_grammar.Grammar_verbosity_level_set)
    total_time = property(_constraint_grammar.Grammar_total_time_get, _constraint_grammar.Grammar_total_time_set)
    single_tags_list = property(_constraint_grammar.Grammar_single_tags_list_get, _constraint_grammar.Grammar_single_tags_list_set)
    single_tags = property(_constraint_grammar.Grammar_single_tags_get, _constraint_grammar.Grammar_single_tags_set)
    sets_list = property(_constraint_grammar.Grammar_sets_list_get, _constraint_grammar.Grammar_sets_list_set)
    sets_all = property(_constraint_grammar.Grammar_sets_all_get, _constraint_grammar.Grammar_sets_all_set)
    sets_by_name = property(_constraint_grammar.Grammar_sets_by_name_get, _constraint_grammar.Grammar_sets_by_name_set)
    set_name_seeds = property(_constraint_grammar.Grammar_set_name_seeds_get, _constraint_grammar.Grammar_set_name_seeds_set)
    sets_by_contents = property(_constraint_grammar.Grammar_sets_by_contents_get, _constraint_grammar.Grammar_sets_by_contents_set)
    set_alias = property(_constraint_grammar.Grammar_set_alias_get, _constraint_grammar.Grammar_set_alias_set)
    maybe_used_sets = property(_constraint_grammar.Grammar_maybe_used_sets_get, _constraint_grammar.Grammar_maybe_used_sets_set)
    static_sets = property(_constraint_grammar.Grammar_static_sets_get, _constraint_grammar.Grammar_static_sets_set)
    regex_tags = property(_constraint_grammar.Grammar_regex_tags_get, _constraint_grammar.Grammar_regex_tags_set)
    icase_tags = property(_constraint_grammar.Grammar_icase_tags_get, _constraint_grammar.Grammar_icase_tags_set)
    templates = property(_constraint_grammar.Grammar_templates_get, _constraint_grammar.Grammar_templates_set)
    contexts = property(_constraint_grammar.Grammar_contexts_get, _constraint_grammar.Grammar_contexts_set)
    rules_by_set = property(_constraint_grammar.Grammar_rules_by_set_get, _constraint_grammar.Grammar_rules_by_set_set)
    rules_by_tag = property(_constraint_grammar.Grammar_rules_by_tag_get, _constraint_grammar.Grammar_rules_by_tag_set)
    sets_by_tag = property(_constraint_grammar.Grammar_sets_by_tag_get, _constraint_grammar.Grammar_sets_by_tag_set)
    rules_any = property(_constraint_grammar.Grammar_rules_any_get, _constraint_grammar.Grammar_rules_any_set)
    sets_any = property(_constraint_grammar.Grammar_sets_any_get, _constraint_grammar.Grammar_sets_any_set)
    delimiters = property(_constraint_grammar.Grammar_delimiters_get, _constraint_grammar.Grammar_delimiters_set)
    soft_delimiters = property(_constraint_grammar.Grammar_soft_delimiters_get, _constraint_grammar.Grammar_soft_delimiters_set)
    text_delimiters = property(_constraint_grammar.Grammar_text_delimiters_get, _constraint_grammar.Grammar_text_delimiters_set)
    tag_any = property(_constraint_grammar.Grammar_tag_any_get, _constraint_grammar.Grammar_tag_any_set)
    preferred_targets = property(_constraint_grammar.Grammar_preferred_targets_get, _constraint_grammar.Grammar_preferred_targets_set)
    reopen_mappings = property(_constraint_grammar.Grammar_reopen_mappings_get, _constraint_grammar.Grammar_reopen_mappings_set)
    parentheses = property(_constraint_grammar.Grammar_parentheses_get, _constraint_grammar.Grammar_parentheses_set)
    parentheses_reverse = property(_constraint_grammar.Grammar_parentheses_reverse_get, _constraint_grammar.Grammar_parentheses_reverse_set)
    sections = property(_constraint_grammar.Grammar_sections_get, _constraint_grammar.Grammar_sections_set)
    anchors = property(_constraint_grammar.Grammar_anchors_get, _constraint_grammar.Grammar_anchors_set)
    rule_by_number = property(_constraint_grammar.Grammar_rule_by_number_get, _constraint_grammar.Grammar_rule_by_number_set)
    before_sections = property(_constraint_grammar.Grammar_before_sections_get, _constraint_grammar.Grammar_before_sections_set)
    rules = property(_constraint_grammar.Grammar_rules_get, _constraint_grammar.Grammar_rules_set)
    after_sections = property(_constraint_grammar.Grammar_after_sections_get, _constraint_grammar.Grammar_after_sections_set)
    null_section = property(_constraint_grammar.Grammar_null_section_get, _constraint_grammar.Grammar_null_section_set)
    wf_rules = property(_constraint_grammar.Grammar_wf_rules_get, _constraint_grammar.Grammar_wf_rules_set)

    def __init__(self):
        _constraint_grammar.Grammar_swiginit(self, _constraint_grammar.new_Grammar())
    __swig_destroy__ = _constraint_grammar.delete_Grammar

    def addSet(self, to):
        return _constraint_grammar.Grammar_addSet(self, to)

    def getSet(self, which):
        return _constraint_grammar.Grammar_getSet(self, which)

    def appendToSet(self, to):
        return _constraint_grammar.Grammar_appendToSet(self, to)

    def undefSet(self, name):
        return _constraint_grammar.Grammar_undefSet(self, name)

    def allocateSet(self):
        return _constraint_grammar.Grammar_allocateSet(self)

    def destroySet(self, set):
        return _constraint_grammar.Grammar_destroySet(self, set)

    def addSetToList(self, s):
        return _constraint_grammar.Grammar_addSetToList(self, s)

    def allocateDummySet(self):
        return _constraint_grammar.Grammar_allocateDummySet(self)

    def removeNumericTags(self, s):
        return _constraint_grammar.Grammar_removeNumericTags(self, s)

    def getTags(self, set, rv):
        return _constraint_grammar.Grammar_getTags(self, set, rv)

    def getTagList_Any(self, *args):
        return _constraint_grammar.Grammar_getTagList_Any(self, *args)

    def addAnchor(self, *args):
        return _constraint_grammar.Grammar_addAnchor(self, *args)

    def allocateTag(self, *args):
        return _constraint_grammar.Grammar_allocateTag(self, *args)

    def addTag(self, tag):
        return _constraint_grammar.Grammar_addTag(self, tag)

    def destroyTag(self, tag):
        return _constraint_grammar.Grammar_destroyTag(self, tag)

    def addTagToSet(self, rtag, set):
        return _constraint_grammar.Grammar_addTagToSet(self, rtag, set)

    def allocateRule(self):
        return _constraint_grammar.Grammar_allocateRule(self)

    def addRule(self, rule):
        return _constraint_grammar.Grammar_addRule(self, rule)

    def destroyRule(self, rule):
        return _constraint_grammar.Grammar_destroyRule(self, rule)

    def allocateContextualTest(self):
        return _constraint_grammar.Grammar_allocateContextualTest(self)

    def addContextualTest(self, t):
        return _constraint_grammar.Grammar_addContextualTest(self, t)

    def addTemplate(self, test, name):
        return _constraint_grammar.Grammar_addTemplate(self, test, name)

    def reindex(self, unused_sets=False, used_tags=False):
        return _constraint_grammar.Grammar_reindex(self, unused_sets, used_tags)

    def indexSetToRule(self, arg2, arg3):
        return _constraint_grammar.Grammar_indexSetToRule(self, arg2, arg3)

    def indexTagToRule(self, arg2, arg3):
        return _constraint_grammar.Grammar_indexTagToRule(self, arg2, arg3)

    def indexSets(self, arg2, arg3):
        return _constraint_grammar.Grammar_indexSets(self, arg2, arg3)

    def indexTagToSet(self, arg2, arg3):
        return _constraint_grammar.Grammar_indexTagToSet(self, arg2, arg3)

    def setAdjustSets(self, arg2):
        return _constraint_grammar.Grammar_setAdjustSets(self, arg2)

    def contextAdjustTarget(self, arg2):
        return _constraint_grammar.Grammar_contextAdjustTarget(self, arg2)

# Register Grammar in _constraint_grammar:
_constraint_grammar.Grammar_swigregister(Grammar)

def trie_unserialize(*args):
    return _constraint_grammar.trie_unserialize(*args)
class CGProc(Grammar):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, dictionary_path):
        _constraint_grammar.CGProc_swiginit(self, _constraint_grammar.new_CGProc(dictionary_path))

    def cg_proc(self, argc, input_path, output_path):
        return _constraint_grammar.CGProc_cg_proc(self, argc, input_path, output_path)
    __swig_destroy__ = _constraint_grammar.delete_CGProc

# Register CGProc in _constraint_grammar:
_constraint_grammar.CGProc_swigregister(CGProc)

