# 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 _pocketsphinx
else:
    import _pocketsphinx

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__)


import sphinxbase
class Hypothesis(object):
    r"""Proxy of C Hypothesis struct."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    hypstr = property(_pocketsphinx.Hypothesis_hypstr_get, _pocketsphinx.Hypothesis_hypstr_set, doc=r"""hypstr : p.char""")
    best_score = property(_pocketsphinx.Hypothesis_best_score_get, _pocketsphinx.Hypothesis_best_score_set, doc=r"""best_score : int""")
    prob = property(_pocketsphinx.Hypothesis_prob_get, _pocketsphinx.Hypothesis_prob_set, doc=r"""prob : int""")

    def __init__(self, hypstr, best_score, prob):
        r"""__init__(Hypothesis self, char const * hypstr, int best_score, int prob) -> Hypothesis"""
        _pocketsphinx.Hypothesis_swiginit(self, _pocketsphinx.new_Hypothesis(hypstr, best_score, prob))
    __swig_destroy__ = _pocketsphinx.delete_Hypothesis

# Register Hypothesis in _pocketsphinx:
_pocketsphinx.Hypothesis_swigregister(Hypothesis)

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

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    word = property(_pocketsphinx.Segment_word_get, _pocketsphinx.Segment_word_set, doc=r"""word : p.char""")
    ascore = property(_pocketsphinx.Segment_ascore_get, _pocketsphinx.Segment_ascore_set, doc=r"""ascore : int""")
    lscore = property(_pocketsphinx.Segment_lscore_get, _pocketsphinx.Segment_lscore_set, doc=r"""lscore : int""")
    lback = property(_pocketsphinx.Segment_lback_get, _pocketsphinx.Segment_lback_set, doc=r"""lback : int""")
    prob = property(_pocketsphinx.Segment_prob_get, _pocketsphinx.Segment_prob_set, doc=r"""prob : int""")
    start_frame = property(_pocketsphinx.Segment_start_frame_get, _pocketsphinx.Segment_start_frame_set, doc=r"""start_frame : int""")
    end_frame = property(_pocketsphinx.Segment_end_frame_get, _pocketsphinx.Segment_end_frame_set, doc=r"""end_frame : int""")

    @staticmethod
    def fromIter(itor):
        r"""fromIter(void * itor) -> Segment"""
        return _pocketsphinx.Segment_fromIter(itor)
    __swig_destroy__ = _pocketsphinx.delete_Segment

    def __init__(self):
        r"""__init__(Segment self) -> Segment"""
        _pocketsphinx.Segment_swiginit(self, _pocketsphinx.new_Segment())

# Register Segment in _pocketsphinx:
_pocketsphinx.Segment_swigregister(Segment)

def Segment_fromIter(itor):
    r"""Segment_fromIter(void * itor) -> Segment"""
    return _pocketsphinx.Segment_fromIter(itor)

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

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    hypstr = property(_pocketsphinx.NBest_hypstr_get, _pocketsphinx.NBest_hypstr_set, doc=r"""hypstr : p.char""")
    score = property(_pocketsphinx.NBest_score_get, _pocketsphinx.NBest_score_set, doc=r"""score : int""")

    @staticmethod
    def fromIter(itor):
        r"""fromIter(void * itor) -> NBest"""
        return _pocketsphinx.NBest_fromIter(itor)

    def hyp(self):
        r"""hyp(NBest self) -> Hypothesis"""
        return _pocketsphinx.NBest_hyp(self)
    __swig_destroy__ = _pocketsphinx.delete_NBest

    def __init__(self):
        r"""__init__(NBest self) -> NBest"""
        _pocketsphinx.NBest_swiginit(self, _pocketsphinx.new_NBest())

# Register NBest in _pocketsphinx:
_pocketsphinx.NBest_swigregister(NBest)

def NBest_fromIter(itor):
    r"""NBest_fromIter(void * itor) -> NBest"""
    return _pocketsphinx.NBest_fromIter(itor)

class SegmentIterator(object):
    r"""Proxy of C SegmentIterator 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__(SegmentIterator self, void * ptr) -> SegmentIterator"""
        _pocketsphinx.SegmentIterator_swiginit(self, _pocketsphinx.new_SegmentIterator(ptr))
    __swig_destroy__ = _pocketsphinx.delete_SegmentIterator

    def next(self):
        r"""next(SegmentIterator self) -> Segment"""
        return _pocketsphinx.SegmentIterator_next(self)

    def __next__(self):
        r"""__next__(SegmentIterator self) -> Segment"""
        return _pocketsphinx.SegmentIterator___next__(self)

# Register SegmentIterator in _pocketsphinx:
_pocketsphinx.SegmentIterator_swigregister(SegmentIterator)

class NBestIterator(object):
    r"""Proxy of C NBestIterator 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__(NBestIterator self, void * ptr) -> NBestIterator"""
        _pocketsphinx.NBestIterator_swiginit(self, _pocketsphinx.new_NBestIterator(ptr))
    __swig_destroy__ = _pocketsphinx.delete_NBestIterator

    def next(self):
        r"""next(NBestIterator self) -> NBest"""
        return _pocketsphinx.NBestIterator_next(self)

    def __next__(self):
        r"""__next__(NBestIterator self) -> NBest"""
        return _pocketsphinx.NBestIterator___next__(self)

# Register NBestIterator in _pocketsphinx:
_pocketsphinx.NBestIterator_swigregister(NBestIterator)

class Decoder(object):
    r"""Proxy of C Decoder 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__(Decoder self) -> Decoder
        __init__(Decoder self, Config config) -> Decoder
        """
        _pocketsphinx.Decoder_swiginit(self, _pocketsphinx.new_Decoder(*args))
    __swig_destroy__ = _pocketsphinx.delete_Decoder

    def reinit(self, config):
        r"""reinit(Decoder self, Config config)"""
        return _pocketsphinx.Decoder_reinit(self, config)

    def load_dict(self, fdict, ffilter, format):
        r"""load_dict(Decoder self, char const * fdict, char const * ffilter, char const * format)"""
        return _pocketsphinx.Decoder_load_dict(self, fdict, ffilter, format)

    def save_dict(self, dictfile, format):
        r"""save_dict(Decoder self, char const * dictfile, char const * format)"""
        return _pocketsphinx.Decoder_save_dict(self, dictfile, format)

    def add_word(self, word, phones, update):
        r"""add_word(Decoder self, char const * word, char const * phones, int update)"""
        return _pocketsphinx.Decoder_add_word(self, word, phones, update)

    def lookup_word(self, word):
        r"""lookup_word(Decoder self, char const * word) -> char *"""
        return _pocketsphinx.Decoder_lookup_word(self, word)

    def get_lattice(self):
        r"""get_lattice(Decoder self) -> Lattice"""
        return _pocketsphinx.Decoder_get_lattice(self)

    def get_config(self):
        r"""get_config(Decoder self) -> Config"""
        return _pocketsphinx.Decoder_get_config(self)

    @staticmethod
    def default_config():
        r"""default_config() -> Config"""
        return _pocketsphinx.Decoder_default_config()

    @staticmethod
    def file_config(path):
        r"""file_config(char const * path) -> Config"""
        return _pocketsphinx.Decoder_file_config(path)

    def start_stream(self):
        r"""start_stream(Decoder self)"""
        return _pocketsphinx.Decoder_start_stream(self)

    def start_utt(self):
        r"""start_utt(Decoder self)"""
        return _pocketsphinx.Decoder_start_utt(self)

    def end_utt(self):
        r"""end_utt(Decoder self)"""
        return _pocketsphinx.Decoder_end_utt(self)

    def process_raw(self, SDATA, no_search, full_utt):
        r"""process_raw(Decoder self, char const * SDATA, bool no_search, bool full_utt) -> int"""
        return _pocketsphinx.Decoder_process_raw(self, SDATA, no_search, full_utt)

    def process_cep(self, SDATA, no_search, full_utt):
        r"""process_cep(Decoder self, char const * SDATA, bool no_search, bool full_utt) -> int"""
        return _pocketsphinx.Decoder_process_cep(self, SDATA, no_search, full_utt)

    def hyp(self):
        r"""hyp(Decoder self) -> Hypothesis"""
        return _pocketsphinx.Decoder_hyp(self)

    def get_fe(self):
        r"""get_fe(Decoder self) -> FrontEnd"""
        return _pocketsphinx.Decoder_get_fe(self)

    def get_feat(self):
        r"""get_feat(Decoder self) -> Feature"""
        return _pocketsphinx.Decoder_get_feat(self)

    def get_in_speech(self):
        r"""get_in_speech(Decoder self) -> bool"""
        return _pocketsphinx.Decoder_get_in_speech(self)

    def get_fsg(self, name):
        r"""get_fsg(Decoder self, char const * name) -> FsgModel"""
        return _pocketsphinx.Decoder_get_fsg(self, name)

    def set_fsg(self, name, fsg):
        r"""set_fsg(Decoder self, char const * name, FsgModel fsg)"""
        return _pocketsphinx.Decoder_set_fsg(self, name, fsg)

    def set_jsgf_file(self, name, path):
        r"""set_jsgf_file(Decoder self, char const * name, char const * path)"""
        return _pocketsphinx.Decoder_set_jsgf_file(self, name, path)

    def set_jsgf_string(self, name, jsgf_string):
        r"""set_jsgf_string(Decoder self, char const * name, char const * jsgf_string)"""
        return _pocketsphinx.Decoder_set_jsgf_string(self, name, jsgf_string)

    def get_kws(self, name):
        r"""get_kws(Decoder self, char const * name) -> char const *"""
        return _pocketsphinx.Decoder_get_kws(self, name)

    def set_kws(self, name, keyfile):
        r"""set_kws(Decoder self, char const * name, char const * keyfile)"""
        return _pocketsphinx.Decoder_set_kws(self, name, keyfile)

    def set_keyphrase(self, name, keyphrase):
        r"""set_keyphrase(Decoder self, char const * name, char const * keyphrase)"""
        return _pocketsphinx.Decoder_set_keyphrase(self, name, keyphrase)

    def set_allphone_file(self, name, lmfile):
        r"""set_allphone_file(Decoder self, char const * name, char const * lmfile)"""
        return _pocketsphinx.Decoder_set_allphone_file(self, name, lmfile)

    def get_lm(self, name):
        r"""get_lm(Decoder self, char const * name) -> NGramModel"""
        return _pocketsphinx.Decoder_get_lm(self, name)

    def set_lm(self, name, lm):
        r"""set_lm(Decoder self, char const * name, NGramModel lm)"""
        return _pocketsphinx.Decoder_set_lm(self, name, lm)

    def set_lm_file(self, name, path):
        r"""set_lm_file(Decoder self, char const * name, char const * path)"""
        return _pocketsphinx.Decoder_set_lm_file(self, name, path)

    def get_logmath(self):
        r"""get_logmath(Decoder self) -> LogMath"""
        return _pocketsphinx.Decoder_get_logmath(self)

    def set_search(self, search_name):
        r"""set_search(Decoder self, char const * search_name)"""
        return _pocketsphinx.Decoder_set_search(self, search_name)

    def unset_search(self, search_name):
        r"""unset_search(Decoder self, char const * search_name)"""
        return _pocketsphinx.Decoder_unset_search(self, search_name)

    def get_search(self):
        r"""get_search(Decoder self) -> char const *"""
        return _pocketsphinx.Decoder_get_search(self)

    def n_frames(self):
        r"""n_frames(Decoder self) -> int"""
        return _pocketsphinx.Decoder_n_frames(self)

    def seg(self):
        r"""seg(Decoder self) -> SegmentList"""
        return _pocketsphinx.Decoder_seg(self)

    def nbest(self):
        r"""nbest(Decoder self) -> NBestList"""
        return _pocketsphinx.Decoder_nbest(self)

# Register Decoder in _pocketsphinx:
_pocketsphinx.Decoder_swigregister(Decoder)

def Decoder_default_config():
    r"""Decoder_default_config() -> Config"""
    return _pocketsphinx.Decoder_default_config()

def Decoder_file_config(path):
    r"""Decoder_file_config(char const * path) -> Config"""
    return _pocketsphinx.Decoder_file_config(path)

class Lattice(object):
    r"""Proxy of C Lattice 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__(Lattice self, char const * path) -> Lattice
        __init__(Lattice self, Decoder decoder, char * path) -> Lattice
        """
        _pocketsphinx.Lattice_swiginit(self, _pocketsphinx.new_Lattice(*args))
    __swig_destroy__ = _pocketsphinx.delete_Lattice

    def write(self, path):
        r"""write(Lattice self, char const * path)"""
        return _pocketsphinx.Lattice_write(self, path)

    def write_htk(self, path):
        r"""write_htk(Lattice self, char const * path)"""
        return _pocketsphinx.Lattice_write_htk(self, path)

# Register Lattice in _pocketsphinx:
_pocketsphinx.Lattice_swigregister(Lattice)

class NBestList(object):
    r"""Proxy of C NBestList 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

    def __iter__(self):
        r"""__iter__(NBestList self) -> NBestIterator"""
        return _pocketsphinx.NBestList___iter__(self)
    __swig_destroy__ = _pocketsphinx.delete_NBestList

# Register NBestList in _pocketsphinx:
_pocketsphinx.NBestList_swigregister(NBestList)

class SegmentList(object):
    r"""Proxy of C SegmentList 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

    def __iter__(self):
        r"""__iter__(SegmentList self) -> SegmentIterator"""
        return _pocketsphinx.SegmentList___iter__(self)
    __swig_destroy__ = _pocketsphinx.delete_SegmentList

# Register SegmentList in _pocketsphinx:
_pocketsphinx.SegmentList_swigregister(SegmentList)



