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

"""
This documentation was automatically generated using original comments in
Doxygen format. As some C types and data structures cannot be directly mapped
into Python types, some non-trivial type conversion could have place.
Basically a type is replaced with another one that has the closest match, and
sometimes one argument of generated function comprises several arguments of the
original function (usually two).

Functions having error code as the return value and returning effective
value in one of its arguments are transformed so that the effective value is
returned in a regular fashion and run-time exception is being thrown in case of
negative error code.
"""

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _sphinxbase
else:
    import _sphinxbase

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 == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, 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 Config(object):
    r"""Proxy of C Config struct."""

    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")
    __repr__ = _swig_repr
    __swig_destroy__ = _sphinxbase.delete_Config

    def set_boolean(self, key, val):
        r"""set_boolean(Config self, char const * key, bool val)"""
        return _sphinxbase.Config_set_boolean(self, key, val)

    def set_int(self, key, val):
        r"""set_int(Config self, char const * key, int val)"""
        return _sphinxbase.Config_set_int(self, key, val)

    def set_float(self, key, val):
        r"""set_float(Config self, char const * key, double val)"""
        return _sphinxbase.Config_set_float(self, key, val)

    def set_string(self, key, val):
        r"""set_string(Config self, char const * key, char const * val)"""
        return _sphinxbase.Config_set_string(self, key, val)

    def set_string_extra(self, key, val):
        r"""set_string_extra(Config self, char const * key, char const * val)"""
        return _sphinxbase.Config_set_string_extra(self, key, val)

    def exists(self, key):
        r"""exists(Config self, char const * key) -> bool"""
        return _sphinxbase.Config_exists(self, key)

    def get_boolean(self, key):
        r"""get_boolean(Config self, char const * key) -> bool"""
        return _sphinxbase.Config_get_boolean(self, key)

    def get_int(self, key):
        r"""get_int(Config self, char const * key) -> int"""
        return _sphinxbase.Config_get_int(self, key)

    def get_float(self, key):
        r"""get_float(Config self, char const * key) -> double"""
        return _sphinxbase.Config_get_float(self, key)

    def get_string(self, key):
        r"""get_string(Config self, char const * key) -> char const *"""
        return _sphinxbase.Config_get_string(self, key)

# Register Config in _sphinxbase:
_sphinxbase.Config_swigregister(Config)

class FrontEnd(object):
    r"""Proxy of C FrontEnd struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(FrontEnd self) -> FrontEnd"""
        _sphinxbase.FrontEnd_swiginit(self, _sphinxbase.new_FrontEnd())
    __swig_destroy__ = _sphinxbase.delete_FrontEnd

    def output_size(self):
        r"""output_size(FrontEnd self) -> int"""
        return _sphinxbase.FrontEnd_output_size(self)

    def process_utt(self, spch, nsamps, cep_block):
        r"""process_utt(FrontEnd self, char * spch, size_t nsamps, mfcc_t *** cep_block) -> int"""
        return _sphinxbase.FrontEnd_process_utt(self, spch, nsamps, cep_block)

# Register FrontEnd in _sphinxbase:
_sphinxbase.FrontEnd_swigregister(FrontEnd)

class Feature(object):
    r"""Proxy of C Feature struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _sphinxbase.delete_Feature

    def __init__(self):
        r"""__init__(Feature self) -> Feature"""
        _sphinxbase.Feature_swiginit(self, _sphinxbase.new_Feature())

# Register Feature in _sphinxbase:
_sphinxbase.Feature_swigregister(Feature)

class FsgModel(object):
    r"""Proxy of C FsgModel struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        r"""
        __init__(FsgModel self, char const * name, LogMath logmath, float lw, int n) -> FsgModel
        __init__(FsgModel self, char const * path, LogMath logmath, float lw) -> FsgModel
        """
        _sphinxbase.FsgModel_swiginit(self, _sphinxbase.new_FsgModel(*args))
    __swig_destroy__ = _sphinxbase.delete_FsgModel

    def word_id(self, word):
        r"""word_id(FsgModel self, char const * word) -> int"""
        return _sphinxbase.FsgModel_word_id(self, word)

    def word_add(self, word):
        r"""word_add(FsgModel self, char const * word) -> int"""
        return _sphinxbase.FsgModel_word_add(self, word)

    def trans_add(self, src, dst, logp, wid):
        r"""trans_add(FsgModel self, int src, int dst, int logp, int wid)"""
        return _sphinxbase.FsgModel_trans_add(self, src, dst, logp, wid)

    def null_trans_add(self, src, dst, logp):
        r"""null_trans_add(FsgModel self, int src, int dst, int logp) -> int"""
        return _sphinxbase.FsgModel_null_trans_add(self, src, dst, logp)

    def tag_trans_add(self, src, dst, logp, wid):
        r"""tag_trans_add(FsgModel self, int src, int dst, int logp, int wid) -> int"""
        return _sphinxbase.FsgModel_tag_trans_add(self, src, dst, logp, wid)

    def add_silence(self, silword, state, silprob):
        r"""add_silence(FsgModel self, char const * silword, int state, float silprob) -> int"""
        return _sphinxbase.FsgModel_add_silence(self, silword, state, silprob)

    def add_alt(self, baseword, altword):
        r"""add_alt(FsgModel self, char const * baseword, char const * altword) -> int"""
        return _sphinxbase.FsgModel_add_alt(self, baseword, altword)

    def writefile(self, path):
        r"""writefile(FsgModel self, char const * path)"""
        return _sphinxbase.FsgModel_writefile(self, path)

# Register FsgModel in _sphinxbase:
_sphinxbase.FsgModel_swigregister(FsgModel)

class JsgfRule(object):
    r"""Proxy of C JsgfRule struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(JsgfRule self) -> JsgfRule"""
        _sphinxbase.JsgfRule_swiginit(self, _sphinxbase.new_JsgfRule())

    @staticmethod
    def fromIter(itor):
        r"""fromIter(void * itor) -> JsgfRule"""
        return _sphinxbase.JsgfRule_fromIter(itor)

    def get_name(self):
        r"""get_name(JsgfRule self) -> char const *"""
        return _sphinxbase.JsgfRule_get_name(self)

    def is_public(self):
        r"""is_public(JsgfRule self) -> bool"""
        return _sphinxbase.JsgfRule_is_public(self)
    __swig_destroy__ = _sphinxbase.delete_JsgfRule

# Register JsgfRule in _sphinxbase:
_sphinxbase.JsgfRule_swigregister(JsgfRule)

def JsgfRule_fromIter(itor):
    r"""JsgfRule_fromIter(void * itor) -> JsgfRule"""
    return _sphinxbase.JsgfRule_fromIter(itor)

class NGramModel(object):
    r"""Proxy of C NGramModel struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    @staticmethod
    def fromIter(itor):
        r"""fromIter(void * itor) -> NGramModel"""
        return _sphinxbase.NGramModel_fromIter(itor)

    def __init__(self, *args):
        r"""
        __init__(NGramModel self, char const * path) -> NGramModel
        __init__(NGramModel self, Config config, LogMath logmath, char const * path) -> NGramModel
        """
        _sphinxbase.NGramModel_swiginit(self, _sphinxbase.new_NGramModel(*args))
    __swig_destroy__ = _sphinxbase.delete_NGramModel

    def write(self, path, ftype):
        r"""write(NGramModel self, char const * path, int ftype)"""
        return _sphinxbase.NGramModel_write(self, path, ftype)

    def str_to_type(self, str):
        r"""str_to_type(NGramModel self, char const * str) -> int"""
        return _sphinxbase.NGramModel_str_to_type(self, str)

    def type_to_str(self, type):
        r"""type_to_str(NGramModel self, int type) -> char const *"""
        return _sphinxbase.NGramModel_type_to_str(self, type)

    def casefold(self, kase):
        r"""casefold(NGramModel self, int kase)"""
        return _sphinxbase.NGramModel_casefold(self, kase)

    def size(self):
        r"""size(NGramModel self) -> int"""
        return _sphinxbase.NGramModel_size(self)

    def add_word(self, word, weight):
        r"""add_word(NGramModel self, char const * word, float weight) -> int"""
        return _sphinxbase.NGramModel_add_word(self, word, weight)

    def prob(self, n):
        r"""prob(NGramModel self, size_t n) -> int"""
        return _sphinxbase.NGramModel_prob(self, n)

# Register NGramModel in _sphinxbase:
_sphinxbase.NGramModel_swigregister(NGramModel)

def NGramModel_fromIter(itor):
    r"""NGramModel_fromIter(void * itor) -> NGramModel"""
    return _sphinxbase.NGramModel_fromIter(itor)

class LogMath(object):
    r"""Proxy of C LogMath struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(LogMath self) -> LogMath"""
        _sphinxbase.LogMath_swiginit(self, _sphinxbase.new_LogMath())
    __swig_destroy__ = _sphinxbase.delete_LogMath

    def exp(self, prob):
        r"""exp(LogMath self, int prob) -> double"""
        return _sphinxbase.LogMath_exp(self, prob)

# Register LogMath in _sphinxbase:
_sphinxbase.LogMath_swigregister(LogMath)

class NGramModelSetIterator(object):
    r"""Proxy of C NGramModelSetIterator struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, ptr):
        r"""__init__(NGramModelSetIterator self, void * ptr) -> NGramModelSetIterator"""
        _sphinxbase.NGramModelSetIterator_swiginit(self, _sphinxbase.new_NGramModelSetIterator(ptr))
    __swig_destroy__ = _sphinxbase.delete_NGramModelSetIterator

    def next(self):
        r"""next(NGramModelSetIterator self) -> NGramModel"""
        return _sphinxbase.NGramModelSetIterator_next(self)

    def __next__(self):
        r"""__next__(NGramModelSetIterator self) -> NGramModel"""
        return _sphinxbase.NGramModelSetIterator___next__(self)

# Register NGramModelSetIterator in _sphinxbase:
_sphinxbase.NGramModelSetIterator_swigregister(NGramModelSetIterator)

class JsgfIterator(object):
    r"""Proxy of C JsgfIterator struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, ptr):
        r"""__init__(JsgfIterator self, void * ptr) -> JsgfIterator"""
        _sphinxbase.JsgfIterator_swiginit(self, _sphinxbase.new_JsgfIterator(ptr))
    __swig_destroy__ = _sphinxbase.delete_JsgfIterator

    def next(self):
        r"""next(JsgfIterator self) -> JsgfRule"""
        return _sphinxbase.JsgfIterator_next(self)

    def __next__(self):
        r"""__next__(JsgfIterator self) -> JsgfRule"""
        return _sphinxbase.JsgfIterator___next__(self)

# Register JsgfIterator in _sphinxbase:
_sphinxbase.JsgfIterator_swigregister(JsgfIterator)

class NGramModelSet(object):
    r"""Proxy of C NGramModelSet struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __iter__(self):
        r"""__iter__(NGramModelSet self) -> NGramModelSetIterator"""
        return _sphinxbase.NGramModelSet___iter__(self)

    def __init__(self, config, logmath, path):
        r"""__init__(NGramModelSet self, Config config, LogMath logmath, char const * path) -> NGramModelSet"""
        _sphinxbase.NGramModelSet_swiginit(self, _sphinxbase.new_NGramModelSet(config, logmath, path))
    __swig_destroy__ = _sphinxbase.delete_NGramModelSet

    def count(self):
        r"""count(NGramModelSet self) -> int"""
        return _sphinxbase.NGramModelSet_count(self)

    def add(self, model, name, weight, reuse_widmap):
        r"""add(NGramModelSet self, NGramModel model, char const * name, float weight, bool reuse_widmap) -> NGramModel"""
        return _sphinxbase.NGramModelSet_add(self, model, name, weight, reuse_widmap)

    def select(self, name):
        r"""select(NGramModelSet self, char const * name) -> NGramModel"""
        return _sphinxbase.NGramModelSet_select(self, name)

    def lookup(self, name):
        r"""lookup(NGramModelSet self, char const * name) -> NGramModel"""
        return _sphinxbase.NGramModelSet_lookup(self, name)

    def current(self):
        r"""current(NGramModelSet self) -> char const *"""
        return _sphinxbase.NGramModelSet_current(self)

# Register NGramModelSet in _sphinxbase:
_sphinxbase.NGramModelSet_swigregister(NGramModelSet)

class Jsgf(object):
    r"""Proxy of C Jsgf struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __iter__(self):
        r"""__iter__(Jsgf self) -> JsgfIterator"""
        return _sphinxbase.Jsgf___iter__(self)

    def __init__(self, path):
        r"""__init__(Jsgf self, char const * path) -> Jsgf"""
        _sphinxbase.Jsgf_swiginit(self, _sphinxbase.new_Jsgf(path))
    __swig_destroy__ = _sphinxbase.delete_Jsgf

    def get_name(self):
        r"""get_name(Jsgf self) -> char const *"""
        return _sphinxbase.Jsgf_get_name(self)

    def get_rule(self, name):
        r"""get_rule(Jsgf self, char const * name) -> JsgfRule"""
        return _sphinxbase.Jsgf_get_rule(self, name)

    def build_fsg(self, rule, logmath, lw):
        r"""build_fsg(Jsgf self, JsgfRule rule, LogMath logmath, float lw) -> FsgModel"""
        return _sphinxbase.Jsgf_build_fsg(self, rule, logmath, lw)

# Register Jsgf in _sphinxbase:
_sphinxbase.Jsgf_swigregister(Jsgf)



