/* Generated by Cython 0.13 on Sat Oct 16 11:46:23 2010 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif

#ifndef PySet_CheckExact
#  define PySet_CheckExact(obj)          (Py_TYPE(obj) == &PySet_Type)
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject PyLongObject
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE_API__pocketsphinx
#include "sphinxbase/logmath.h"
#include "sphinxbase/cmd_ln.h"
#include "sphinxbase/ckd_alloc.h"
#include "sphinxbase/fsg_model.h"
#include "sphinxbase/ngram_model.h"
#include "sphinxbase/huff_code.h"
#include "stdio.h"
#include "bogus_pygobject.h"
#include "fsg_set.h"
#include "ps_lattice.h"
#include "pocketsphinx.h"

/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE 
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__)) 
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__)) 
# else
#   define CYTHON_UNUSED 
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "pocketsphinx.pyx",
  "sphinxbase.pxd",
  "pocketsphinx.pxd",
};

typedef float __pyx_t_10sphinxbase_float32;

typedef int __pyx_t_10sphinxbase_int32;

typedef double __pyx_t_10sphinxbase_float64;

/* Type declarations */

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":159
 *     cdef set_iter(NGramIter self, ngram_iter_t *itor)
 * 
 * cdef class HuffCode:             # <<<<<<<<<<<<<<
 *     cdef huff_code_t *hc
 *     cdef file fh
 */

struct __pyx_obj_10sphinxbase_HuffCode {
  PyObject_HEAD
  huff_code_t *hc;
  PyObject *fh;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":138
 * 
 * # Extension classes
 * cdef class NGramModel:             # <<<<<<<<<<<<<<
 *     cdef ngram_model_t *lm
 *     cdef logmath_t *lmath
 */

struct __pyx_obj_10sphinxbase_NGramModel {
  PyObject_HEAD
  struct __pyx_vtabstruct_10sphinxbase_NGramModel *__pyx_vtab;
  ngram_model_t *lm;
  logmath_t *lmath;
  float lw;
  float wip;
  float uw;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":151
 *     cdef readonly n_frames
 * 
 * cdef class LatLink:             # <<<<<<<<<<<<<<
 *     cdef ps_latlink_t *link
 *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
 */

struct __pyx_obj_12pocketsphinx_LatLink {
  PyObject_HEAD
  struct __pyx_vtabstruct_12pocketsphinx_LatLink *__pyx_vtab;
  ps_latlink_t *link;
  ps_lattice_t *dag;
  char *word;
  char *baseword;
  int sf;
  int ef;
  double prob;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":164
 *     cdef int first_link
 * 
 * cdef class LatNode:             # <<<<<<<<<<<<<<
 *     cdef ps_latnode_t *node
 *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
 */

struct __pyx_obj_12pocketsphinx_LatNode {
  PyObject_HEAD
  struct __pyx_vtabstruct_12pocketsphinx_LatNode *__pyx_vtab;
  ps_latnode_t *node;
  ps_lattice_t *dag;
  char *word;
  char *baseword;
  int sf;
  int fef;
  int lef;
  double prob;
  struct __pyx_obj_12pocketsphinx_LatLink *best_exit;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":138
 * 
 * # Now, our extension classes
 * cdef class Decoder:             # <<<<<<<<<<<<<<
 *     cdef ps_decoder_t *ps
 *     cdef char **argv
 */

struct __pyx_obj_12pocketsphinx_Decoder {
  PyObject_HEAD
  struct __pyx_vtabstruct_12pocketsphinx_Decoder *__pyx_vtab;
  ps_decoder_t *ps;
  char **argv;
  int argc;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":146
 *     cdef set_lmath(NGramModel self, logmath_t *lmath)
 * 
 * cdef class LogMath:             # <<<<<<<<<<<<<<
 *     cdef logmath_t *lmath
 * 
 */

struct __pyx_obj_10sphinxbase_LogMath {
  PyObject_HEAD
  logmath_t *lmath;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":173
 *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
 * 
 * cdef class LatNodeIterator:             # <<<<<<<<<<<<<<
 *     cdef ps_lattice_t *dag
 *     cdef ps_latnode_iter_t *itor
 */

struct __pyx_obj_12pocketsphinx_LatNodeIterator {
  PyObject_HEAD
  ps_lattice_t *dag;
  ps_latnode_iter_t *itor;
  int first_node;
  int start;
  int end;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":144
 *     cdef set_boxed(Decoder self, box)
 * 
 * cdef class Lattice:             # <<<<<<<<<<<<<<
 *     cdef ps_lattice_t *dag
 *     cdef read_dag(Lattice self, Decoder ps, latfile)
 */

struct __pyx_obj_12pocketsphinx_Lattice {
  PyObject_HEAD
  struct __pyx_vtabstruct_12pocketsphinx_Lattice *__pyx_vtab;
  ps_lattice_t *dag;
  PyObject *n_frames;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":159
 *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
 * 
 * cdef class LatLinkIterator:             # <<<<<<<<<<<<<<
 *     cdef ps_lattice_t *dag
 *     cdef ps_latlink_iter_t *itor
 */

struct __pyx_obj_12pocketsphinx_LatLinkIterator {
  PyObject_HEAD
  ps_lattice_t *dag;
  ps_latlink_iter_t *itor;
  int first_link;
};

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":149
 *     cdef logmath_t *lmath
 * 
 * cdef class NGramIter:             # <<<<<<<<<<<<<<
 *     cdef NGramModel lm
 *     cdef ngram_iter_t *itor
 */

struct __pyx_obj_10sphinxbase_NGramIter {
  PyObject_HEAD
  struct __pyx_vtabstruct_10sphinxbase_NGramIter *__pyx_vtab;
  struct __pyx_obj_10sphinxbase_NGramModel *lm;
  ngram_iter_t *itor;
  int first_item;
  int m;
  float log_prob;
  float log_bowt;
  PyObject *words;
};


/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":227
 *         return link
 * 
 * cdef class Lattice:             # <<<<<<<<<<<<<<
 *     """
 *     Word lattice.
 */

struct __pyx_vtabstruct_12pocketsphinx_Lattice {
  PyObject *(*read_dag)(struct __pyx_obj_12pocketsphinx_Lattice *, struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *);
  PyObject *(*set_dag)(struct __pyx_obj_12pocketsphinx_Lattice *, ps_lattice_t *);
  PyObject *(*set_boxed)(struct __pyx_obj_12pocketsphinx_Lattice *, PyObject *);
};
static struct __pyx_vtabstruct_12pocketsphinx_Lattice *__pyx_vtabptr_12pocketsphinx_Lattice;


/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":132
 *         return node
 * 
 * cdef class LatLink:             # <<<<<<<<<<<<<<
 *     """
 *     Link (edge) in a word lattice, connecting two nodes.
 */

struct __pyx_vtabstruct_12pocketsphinx_LatLink {
  PyObject *(*set_link)(struct __pyx_obj_12pocketsphinx_LatLink *, ps_lattice_t *, ps_latlink_t *);
};
static struct __pyx_vtabstruct_12pocketsphinx_LatLink *__pyx_vtabptr_12pocketsphinx_LatLink;


/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":149
 *     cdef logmath_t *lmath
 * 
 * cdef class NGramIter:             # <<<<<<<<<<<<<<
 *     cdef NGramModel lm
 *     cdef ngram_iter_t *itor
 */

struct __pyx_vtabstruct_10sphinxbase_NGramIter {
  PyObject *(*set_iter)(struct __pyx_obj_10sphinxbase_NGramIter *, ngram_iter_t *);
};
static struct __pyx_vtabstruct_10sphinxbase_NGramIter *__pyx_vtabptr_10sphinxbase_NGramIter;


/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":371
 *             raise RuntimeError, "Failed to write lattice to %s" % outfile
 * 
 * cdef class Decoder:             # <<<<<<<<<<<<<<
 *     """
 *     PocketSphinx speech decoder.
 */

struct __pyx_vtabstruct_12pocketsphinx_Decoder {
  PyObject *(*set_boxed)(struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *);
};
static struct __pyx_vtabstruct_12pocketsphinx_Decoder *__pyx_vtabptr_12pocketsphinx_Decoder;


/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":10
 * # Author: David Huggins-Daines <dhuggins@cs.cmu.edu>
 * 
 * cdef class LatNode:             # <<<<<<<<<<<<<<
 *     """
 *     Node in a word lattice.
 */

struct __pyx_vtabstruct_12pocketsphinx_LatNode {
  PyObject *(*set_node)(struct __pyx_obj_12pocketsphinx_LatNode *, ps_lattice_t *, ps_latnode_t *);
};
static struct __pyx_vtabstruct_12pocketsphinx_LatNode *__pyx_vtabptr_12pocketsphinx_LatNode;


/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":138
 * 
 * # Extension classes
 * cdef class NGramModel:             # <<<<<<<<<<<<<<
 *     cdef ngram_model_t *lm
 *     cdef logmath_t *lmath
 */

struct __pyx_vtabstruct_10sphinxbase_NGramModel {
  PyObject *(*set_lm)(struct __pyx_obj_10sphinxbase_NGramModel *, ngram_model_t *);
  PyObject *(*set_lmath)(struct __pyx_obj_10sphinxbase_NGramModel *, logmath_t *);
};
static struct __pyx_vtabstruct_10sphinxbase_NGramModel *__pyx_vtabptr_10sphinxbase_NGramModel;

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
  end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);


#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif


static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}


#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
    }
    return r;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from sphinxbase */

static PyTypeObject *__pyx_ptype_10sphinxbase_NGramModel = 0;
static PyTypeObject *__pyx_ptype_10sphinxbase_LogMath = 0;
static PyTypeObject *__pyx_ptype_10sphinxbase_NGramIter = 0;
static PyTypeObject *__pyx_ptype_10sphinxbase_HuffCode = 0;
/* Module declarations from pocketsphinx */

static PyTypeObject *__pyx_ptype_12pocketsphinx_Decoder = 0;
static PyTypeObject *__pyx_ptype_12pocketsphinx_Lattice = 0;
static PyTypeObject *__pyx_ptype_12pocketsphinx_LatLink = 0;
static PyTypeObject *__pyx_ptype_12pocketsphinx_LatLinkIterator = 0;
static PyTypeObject *__pyx_ptype_12pocketsphinx_LatNode = 0;
static PyTypeObject *__pyx_ptype_12pocketsphinx_LatNodeIterator = 0;
#define __Pyx_MODULE_NAME "pocketsphinx"
int __pyx_module_is_main_pocketsphinx = 0;

/* Implementation of pocketsphinx */
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_1[] = "Failed to read lattice from %s";
static char __pyx_k_2[] = "Failed to write lattice to %s";
static char __pyx_k_3[] = "-";
static char __pyx_k_4[] = "Failed to parse argument list";
static char __pyx_k_5[] = "Failed to initialize PocketSphinx";
static char __pyx_k_6[] = "Failed to start utterance processing";
static char __pyx_k_9[] = "Failed to process %d samples of audio data";
static char __pyx_k_10[] = "Failed to stop utterance processing";
static char __pyx_k_11[] = "Failed to create word lattice";
static char __pyx_k_12[] = "-lw";
static char __pyx_k_13[] = "-wip";
static char __pyx_k_14[] = "-uw";
static char __pyx_k_16[] = "LatNode.exits (line 53)";
static char __pyx_k_17[] = "LatNode.entries (line 69)";
static char __pyx_k_18[] = "LatNodeIterator.__next__ (line 98)";
static char __pyx_k_19[] = "LatLink.nodes (line 164)";
static char __pyx_k_20[] = "LatLink.pred (line 181)";
static char __pyx_k_21[] = "LatLinkIterator.__next__ (line 209)";
static char __pyx_k_22[] = "Lattice.bestpath (line 287)";
static char __pyx_k_23[] = "Lattice.posterior (line 317)";
static char __pyx_k_24[] = "Lattice.nodes (line 338)";
static char __pyx_k_25[] = "Lattice.write (line 358)";
static char __pyx_k_26[] = "Decoder.decode_raw (line 441)";
static char __pyx_k_27[] = "Decoder.decode_senscr (line 464)";
static char __pyx_k_28[] = "Decoder.start_utt (line 483)";
static char __pyx_k_29[] = "Decoder.process_raw (line 499)";
static char __pyx_k_30[] = "Decoder.ps_end_utt (line 525)";
static char __pyx_k_31[] = "Decoder.get_hyp (line 532)";
static char __pyx_k_32[] = "Decoder.get_prob (line 555)";
static char __pyx_k_33[] = "Decoder.get_lattice (line 569)";
static char __pyx_k_34[] = "Decoder.get_lmset (line 589)";
static char __pyx_k_35[] = "Decoder.add_word (line 616)";
static char __pyx_k_36[] = "Decoder.load_dict (line 631)";
static char __pyx_k_37[] = "Decoder.save_dict (line 644)";
static char __pyx_k__ef[] = "ef";
static char __pyx_k__fh[] = "fh";
static char __pyx_k__lm[] = "lm";
static char __pyx_k__lw[] = "lw";
static char __pyx_k__ps[] = "ps";
static char __pyx_k__sf[] = "sf";
static char __pyx_k__uw[] = "uw";
static char __pyx_k__dag[] = "dag";
static char __pyx_k__end[] = "end";
static char __pyx_k__fef[] = "fef";
static char __pyx_k__lef[] = "lef";
static char __pyx_k__lwf[] = "lwf";
static char __pyx_k__wip[] = "wip";
static char __pyx_k__argc[] = "argc";
static char __pyx_k__argv[] = "argv";
static char __pyx_k__data[] = "data";
static char __pyx_k__itor[] = "itor";
static char __pyx_k__link[] = "link";
static char __pyx_k__node[] = "node";
static char __pyx_k__pred[] = "pred";
static char __pyx_k__prob[] = "prob";
static char __pyx_k__word[] = "word";
static char __pyx_k__boxed[] = "boxed";
static char __pyx_k__exits[] = "exits";
static char __pyx_k__lmset[] = "lmset";
static char __pyx_k__nodes[] = "nodes";
static char __pyx_k__start[] = "start";
static char __pyx_k__uttid[] = "uttid";
static char __pyx_k__words[] = "words";
static char __pyx_k__write[] = "write";
static char __pyx_k__ascale[] = "ascale";
static char __pyx_k__format[] = "format";
static char __pyx_k__phones[] = "phones";
static char __pyx_k__set_lm[] = "set_lm";
static char __pyx_k__update[] = "update";
static char __pyx_k__Decoder[] = "Decoder";
static char __pyx_k__LatLink[] = "LatLink";
static char __pyx_k__LatNode[] = "LatNode";
static char __pyx_k__Lattice[] = "Lattice";
static char __pyx_k__entries[] = "entries";
static char __pyx_k__get_hyp[] = "get_hyp";
static char __pyx_k__latfile[] = "latfile";
static char __pyx_k__set_dag[] = "set_dag";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____next__[] = "__next__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__add_word[] = "add_word";
static char __pyx_k__baseword[] = "baseword";
static char __pyx_k__bestpath[] = "bestpath";
static char __pyx_k__dictfile[] = "dictfile";
static char __pyx_k__full_utt[] = "full_utt";
static char __pyx_k__get_prob[] = "get_prob";
static char __pyx_k__log_bowt[] = "log_bowt";
static char __pyx_k__log_prob[] = "log_prob";
static char __pyx_k__maxsamps[] = "maxsamps";
static char __pyx_k__n_frames[] = "n_frames";
static char __pyx_k__read_dag[] = "read_dag";
static char __pyx_k__set_link[] = "set_link";
static char __pyx_k__set_node[] = "set_node";
static char __pyx_k__best_exit[] = "best_exit";
static char __pyx_k__fdictfile[] = "fdictfile";
static char __pyx_k__get_lmset[] = "get_lmset";
static char __pyx_k__load_dict[] = "load_dict";
static char __pyx_k__no_search[] = "no_search";
static char __pyx_k__posterior[] = "posterior";
static char __pyx_k__save_dict[] = "save_dict";
static char __pyx_k__set_boxed[] = "set_boxed";
static char __pyx_k__set_lmath[] = "set_lmath";
static char __pyx_k__start_utt[] = "start_utt";
static char __pyx_k__decode_raw[] = "decode_raw";
static char __pyx_k__first_link[] = "first_link";
static char __pyx_k__first_node[] = "first_node";
static char __pyx_k__ps_end_utt[] = "ps_end_utt";
static char __pyx_k__get_lattice[] = "get_lattice";
static char __pyx_k__process_raw[] = "process_raw";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__decode_senscr[] = "decode_senscr";
static char __pyx_k__LatLinkIterator[] = "LatLinkIterator";
static char __pyx_k__LatNodeIterator[] = "LatNodeIterator";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_u_16;
static PyObject *__pyx_kp_u_17;
static PyObject *__pyx_kp_u_18;
static PyObject *__pyx_kp_u_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_u_20;
static PyObject *__pyx_kp_u_21;
static PyObject *__pyx_kp_u_22;
static PyObject *__pyx_kp_u_23;
static PyObject *__pyx_kp_u_24;
static PyObject *__pyx_kp_u_25;
static PyObject *__pyx_kp_u_26;
static PyObject *__pyx_kp_u_27;
static PyObject *__pyx_kp_u_28;
static PyObject *__pyx_kp_u_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_u_30;
static PyObject *__pyx_kp_u_31;
static PyObject *__pyx_kp_u_32;
static PyObject *__pyx_kp_u_33;
static PyObject *__pyx_kp_u_34;
static PyObject *__pyx_kp_u_35;
static PyObject *__pyx_kp_u_36;
static PyObject *__pyx_kp_u_37;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_n_s__Decoder;
static PyObject *__pyx_n_s__LatLink;
static PyObject *__pyx_n_s__LatLinkIterator;
static PyObject *__pyx_n_s__LatNode;
static PyObject *__pyx_n_s__LatNodeIterator;
static PyObject *__pyx_n_s__Lattice;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____next__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__add_word;
static PyObject *__pyx_n_s__argc;
static PyObject *__pyx_n_s__argv;
static PyObject *__pyx_n_s__ascale;
static PyObject *__pyx_n_s__baseword;
static PyObject *__pyx_n_s__best_exit;
static PyObject *__pyx_n_s__bestpath;
static PyObject *__pyx_n_s__boxed;
static PyObject *__pyx_n_s__dag;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__decode_raw;
static PyObject *__pyx_n_s__decode_senscr;
static PyObject *__pyx_n_s__dictfile;
static PyObject *__pyx_n_s__ef;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__entries;
static PyObject *__pyx_n_s__exits;
static PyObject *__pyx_n_s__fdictfile;
static PyObject *__pyx_n_s__fef;
static PyObject *__pyx_n_s__fh;
static PyObject *__pyx_n_s__first_link;
static PyObject *__pyx_n_s__first_node;
static PyObject *__pyx_n_s__format;
static PyObject *__pyx_n_s__full_utt;
static PyObject *__pyx_n_s__get_hyp;
static PyObject *__pyx_n_s__get_lattice;
static PyObject *__pyx_n_s__get_lmset;
static PyObject *__pyx_n_s__get_prob;
static PyObject *__pyx_n_s__itor;
static PyObject *__pyx_n_s__latfile;
static PyObject *__pyx_n_s__lef;
static PyObject *__pyx_n_s__link;
static PyObject *__pyx_n_s__lm;
static PyObject *__pyx_n_s__lmset;
static PyObject *__pyx_n_s__load_dict;
static PyObject *__pyx_n_s__log_bowt;
static PyObject *__pyx_n_s__log_prob;
static PyObject *__pyx_n_s__lw;
static PyObject *__pyx_n_s__lwf;
static PyObject *__pyx_n_s__maxsamps;
static PyObject *__pyx_n_s__n_frames;
static PyObject *__pyx_n_s__no_search;
static PyObject *__pyx_n_s__node;
static PyObject *__pyx_n_s__nodes;
static PyObject *__pyx_n_s__phones;
static PyObject *__pyx_n_s__posterior;
static PyObject *__pyx_n_s__pred;
static PyObject *__pyx_n_s__prob;
static PyObject *__pyx_n_s__process_raw;
static PyObject *__pyx_n_s__ps;
static PyObject *__pyx_n_s__ps_end_utt;
static PyObject *__pyx_n_s__read_dag;
static PyObject *__pyx_n_s__save_dict;
static PyObject *__pyx_n_s__set_boxed;
static PyObject *__pyx_n_s__set_dag;
static PyObject *__pyx_n_s__set_link;
static PyObject *__pyx_n_s__set_lm;
static PyObject *__pyx_n_s__set_lmath;
static PyObject *__pyx_n_s__set_node;
static PyObject *__pyx_n_s__sf;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__start_utt;
static PyObject *__pyx_n_s__update;
static PyObject *__pyx_n_s__uttid;
static PyObject *__pyx_n_s__uw;
static PyObject *__pyx_n_s__wip;
static PyObject *__pyx_n_s__word;
static PyObject *__pyx_n_s__words;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k_7;
static PyObject *__pyx_k_8;
static PyObject *__pyx_k_15;

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":29
 *     @type prob: float
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.node = NULL
 * 
 */

static int __pyx_pf_12pocketsphinx_7LatNode___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_12pocketsphinx_7LatNode___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":30
 *     """
 *     def __cinit__(self):
 *         self.node = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node):
 */
  ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node = NULL;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":32
 *         self.node = NULL
 * 
 *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node):             # <<<<<<<<<<<<<<
 *         """
 *         Internal function - binds this to a PocketSphinx lattice node.
 */

static  PyObject *__pyx_f_12pocketsphinx_7LatNode_set_node(struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_self, ps_lattice_t *__pyx_v_dag, ps_latnode_t *__pyx_v_node) {
  short __pyx_v_fef;
  short __pyx_v_lef;
  ps_latlink_t *__pyx_v_best_exit;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("set_node");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":38
 *         cdef short fef, lef
 *         cdef ps_latlink_t *best_exit
 *         self.dag = dag             # <<<<<<<<<<<<<<
 *         self.node = node
 *         self.word = ps_latnode_word(dag, node)
 */
  __pyx_v_self->dag = __pyx_v_dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":39
 *         cdef ps_latlink_t *best_exit
 *         self.dag = dag
 *         self.node = node             # <<<<<<<<<<<<<<
 *         self.word = ps_latnode_word(dag, node)
 *         self.baseword = ps_latnode_baseword(dag, node)
 */
  __pyx_v_self->node = __pyx_v_node;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":40
 *         self.dag = dag
 *         self.node = node
 *         self.word = ps_latnode_word(dag, node)             # <<<<<<<<<<<<<<
 *         self.baseword = ps_latnode_baseword(dag, node)
 *         self.sf = ps_latnode_times(node, &fef, &lef)
 */
  __pyx_v_self->word = ps_latnode_word(__pyx_v_dag, __pyx_v_node);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":41
 *         self.node = node
 *         self.word = ps_latnode_word(dag, node)
 *         self.baseword = ps_latnode_baseword(dag, node)             # <<<<<<<<<<<<<<
 *         self.sf = ps_latnode_times(node, &fef, &lef)
 *         self.fef = fef
 */
  __pyx_v_self->baseword = ps_latnode_baseword(__pyx_v_dag, __pyx_v_node);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":42
 *         self.word = ps_latnode_word(dag, node)
 *         self.baseword = ps_latnode_baseword(dag, node)
 *         self.sf = ps_latnode_times(node, &fef, &lef)             # <<<<<<<<<<<<<<
 *         self.fef = fef
 *         self.lef = lef
 */
  __pyx_v_self->sf = ps_latnode_times(__pyx_v_node, (&__pyx_v_fef), (&__pyx_v_lef));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":43
 *         self.baseword = ps_latnode_baseword(dag, node)
 *         self.sf = ps_latnode_times(node, &fef, &lef)
 *         self.fef = fef             # <<<<<<<<<<<<<<
 *         self.lef = lef
 *         self.best_exit = None
 */
  __pyx_v_self->fef = __pyx_v_fef;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":44
 *         self.sf = ps_latnode_times(node, &fef, &lef)
 *         self.fef = fef
 *         self.lef = lef             # <<<<<<<<<<<<<<
 *         self.best_exit = None
 *         best_exit = NULL
 */
  __pyx_v_self->lef = __pyx_v_lef;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":45
 *         self.fef = fef
 *         self.lef = lef
 *         self.best_exit = None             # <<<<<<<<<<<<<<
 *         best_exit = NULL
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->best_exit);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->best_exit));
  __pyx_v_self->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":46
 *         self.lef = lef
 *         self.best_exit = None
 *         best_exit = NULL             # <<<<<<<<<<<<<<
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
 *                                          ps_latnode_prob(dag, node, &best_exit))
 */
  __pyx_v_best_exit = NULL;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":47
 *         self.best_exit = None
 *         best_exit = NULL
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),             # <<<<<<<<<<<<<<
 *                                          ps_latnode_prob(dag, node, &best_exit))
 *         if best_exit != NULL:
 */
  __pyx_v_self->prob = logmath_log_to_ln(ps_lattice_get_logmath(__pyx_v_dag), ps_latnode_prob(__pyx_v_dag, __pyx_v_node, (&__pyx_v_best_exit)));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":49
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
 *                                          ps_latnode_prob(dag, node, &best_exit))
 *         if best_exit != NULL:             # <<<<<<<<<<<<<<
 *             self.best_exit = LatLink()
 *             self.best_exit.set_link(dag, best_exit)
 */
  __pyx_t_1 = (__pyx_v_best_exit != NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":50
 *                                          ps_latnode_prob(dag, node, &best_exit))
 *         if best_exit != NULL:
 *             self.best_exit = LatLink()             # <<<<<<<<<<<<<<
 *             self.best_exit.set_link(dag, best_exit)
 * 
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->best_exit);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->best_exit));
    __pyx_v_self->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":51
 *         if best_exit != NULL:
 *             self.best_exit = LatLink()
 *             self.best_exit.set_link(dag, best_exit)             # <<<<<<<<<<<<<<
 * 
 *     def exits(self):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_self->best_exit->__pyx_vtab)->set_link(__pyx_v_self->best_exit, __pyx_v_dag, __pyx_v_best_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pocketsphinx.LatNode.set_node");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":53
 *             self.best_exit.set_link(dag, best_exit)
 * 
 *     def exits(self):             # <<<<<<<<<<<<<<
 *         """
 *         Obtain an iterator over arcs exiting this node.
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_exits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7LatNode_exits[] = "\n        Obtain an iterator over arcs exiting this node.\n\n        @return: Iterator over arcs exiting this node\n        @rtype: LatLinkIterator\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_exits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_12pocketsphinx_LatLinkIterator *__pyx_v_itor;
  ps_latlink_iter_t *__pyx_v_citor;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("exits");
  __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":63
 *         cdef ps_latlink_iter_t *citor
 * 
 *         citor = ps_latnode_exits(self.node)             # <<<<<<<<<<<<<<
 *         itor = LatLinkIterator()
 *         itor.itor = citor
 */
  __pyx_v_citor = ps_latnode_exits(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":64
 * 
 *         citor = ps_latnode_exits(self.node)
 *         itor = LatLinkIterator()             # <<<<<<<<<<<<<<
 *         itor.itor = citor
 *         itor.dag = self.dag
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLinkIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_itor));
  __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":65
 *         citor = ps_latnode_exits(self.node)
 *         itor = LatLinkIterator()
 *         itor.itor = citor             # <<<<<<<<<<<<<<
 *         itor.dag = self.dag
 *         return itor
 */
  __pyx_v_itor->itor = __pyx_v_citor;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":66
 *         itor = LatLinkIterator()
 *         itor.itor = citor
 *         itor.dag = self.dag             # <<<<<<<<<<<<<<
 *         return itor
 * 
 */
  __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":67
 *         itor.itor = citor
 *         itor.dag = self.dag
 *         return itor             # <<<<<<<<<<<<<<
 * 
 *     def entries(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_itor));
  __pyx_r = ((PyObject *)__pyx_v_itor);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.exits");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_itor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":69
 *         return itor
 * 
 *     def entries(self):             # <<<<<<<<<<<<<<
 *         """
 *         Obtain an iterator over arcs entering this node.
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_entries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7LatNode_entries[] = "\n        Obtain an iterator over arcs entering this node.\n\n        @return: Iterator over arcs entering this node\n        @rtype: LatLinkIterator\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_entries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_12pocketsphinx_LatLinkIterator *__pyx_v_itor;
  ps_latlink_iter_t *__pyx_v_citor;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("entries");
  __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":79
 *         cdef ps_latlink_iter_t *citor
 * 
 *         citor = ps_latnode_entries(self.node)             # <<<<<<<<<<<<<<
 *         itor = LatLinkIterator()
 *         itor.itor = citor
 */
  __pyx_v_citor = ps_latnode_entries(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":80
 * 
 *         citor = ps_latnode_entries(self.node)
 *         itor = LatLinkIterator()             # <<<<<<<<<<<<<<
 *         itor.itor = citor
 *         itor.dag = self.dag
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLinkIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_itor));
  __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":81
 *         citor = ps_latnode_entries(self.node)
 *         itor = LatLinkIterator()
 *         itor.itor = citor             # <<<<<<<<<<<<<<
 *         itor.dag = self.dag
 *         return itor
 */
  __pyx_v_itor->itor = __pyx_v_citor;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":82
 *         itor = LatLinkIterator()
 *         itor.itor = citor
 *         itor.dag = self.dag             # <<<<<<<<<<<<<<
 *         return itor
 * 
 */
  __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":83
 *         itor.itor = citor
 *         itor.dag = self.dag
 *         return itor             # <<<<<<<<<<<<<<
 * 
 * cdef class LatNodeIterator:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_itor));
  __pyx_r = ((PyObject *)__pyx_v_itor);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.entries");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_itor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":89
 *     Iterator over word lattice nodes.
 *     """
 *     def __init__(self, start, end):             # <<<<<<<<<<<<<<
 *         self.itor = NULL
 *         self.first_node = True
 */

static int __pyx_pf_12pocketsphinx_15LatNodeIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_12pocketsphinx_15LatNodeIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_end = 0;
  int __pyx_r;
  int __pyx_t_1;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_start = values[0];
    __pyx_v_end = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":90
 *     """
 *     def __init__(self, start, end):
 *         self.itor = NULL             # <<<<<<<<<<<<<<
 *         self.first_node = True
 *         self.start = start
 */
  ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = NULL;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":91
 *     def __init__(self, start, end):
 *         self.itor = NULL
 *         self.first_node = True             # <<<<<<<<<<<<<<
 *         self.start = start
 *         self.end = end
 */
  ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node = 1;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":92
 *         self.itor = NULL
 *         self.first_node = True
 *         self.start = start             # <<<<<<<<<<<<<<
 *         self.end = end
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_start); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->start = __pyx_t_1;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":93
 *         self.first_node = True
 *         self.start = start
 *         self.end = end             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_end); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->end = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":95
 *         self.end = end
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":96
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":98
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Advance iterator and return the next node.
 */

static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___next__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_12pocketsphinx_15LatNodeIterator___next__[] = "\n        Advance iterator and return the next node.\n\n        @return: Next lattice node in this iterator.\n        @rtype: LatNode\n        ";
struct wrapperbase __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__;
static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___next__(PyObject *__pyx_v_self) {
  struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_node;
  int __pyx_v_start;
  ps_latnode_t *__pyx_v_cnode;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__next__");
  __pyx_v_node = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":110
 * 
 *         # Make sure we keep raising exceptions at the end
 *         if self.itor == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         # Advance the iterator if this isn't the first item
 */
  __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":111
 *         # Make sure we keep raising exceptions at the end
 *         if self.itor == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         # Advance the iterator if this isn't the first item
 *         if self.first_node:
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":113
 *             raise StopIteration
 *         # Advance the iterator if this isn't the first item
 *         if self.first_node:             # <<<<<<<<<<<<<<
 *             self.first_node = False
 *         else:
 */
  if (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":114
 *         # Advance the iterator if this isn't the first item
 *         if self.first_node:
 *             self.first_node = False             # <<<<<<<<<<<<<<
 *         else:
 *             self.itor = ps_latnode_iter_next(self.itor)
 */
    ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":116
 *             self.first_node = False
 *         else:
 *             self.itor = ps_latnode_iter_next(self.itor)             # <<<<<<<<<<<<<<
 *             if self.itor == NULL:
 *                 raise StopIteration
 */
    ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = ps_latnode_iter_next(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":117
 *         else:
 *             self.itor = ps_latnode_iter_next(self.itor)
 *             if self.itor == NULL:             # <<<<<<<<<<<<<<
 *                 raise StopIteration
 *         # Look for the next node within the given time range
 */
    __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
    if (__pyx_t_1) {

      /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":118
 *             self.itor = ps_latnode_iter_next(self.itor)
 *             if self.itor == NULL:
 *                 raise StopIteration             # <<<<<<<<<<<<<<
 *         # Look for the next node within the given time range
 *         cnode = ps_latnode_iter_node(self.itor)
 */
      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":120
 *                 raise StopIteration
 *         # Look for the next node within the given time range
 *         cnode = ps_latnode_iter_node(self.itor)             # <<<<<<<<<<<<<<
 *         start = ps_latnode_times(cnode, NULL, NULL)
 *         while start < self.start or start >= self.end:
 */
  __pyx_v_cnode = ps_latnode_iter_node(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":121
 *         # Look for the next node within the given time range
 *         cnode = ps_latnode_iter_node(self.itor)
 *         start = ps_latnode_times(cnode, NULL, NULL)             # <<<<<<<<<<<<<<
 *         while start < self.start or start >= self.end:
 *             self.itor = ps_latnode_iter_next(self.itor)
 */
  __pyx_v_start = ps_latnode_times(__pyx_v_cnode, NULL, NULL);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":122
 *         cnode = ps_latnode_iter_node(self.itor)
 *         start = ps_latnode_times(cnode, NULL, NULL)
 *         while start < self.start or start >= self.end:             # <<<<<<<<<<<<<<
 *             self.itor = ps_latnode_iter_next(self.itor)
 *             if self.itor == NULL:
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_start < ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->start);
    if (!__pyx_t_1) {
      __pyx_t_2 = (__pyx_v_start >= ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->end);
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (!__pyx_t_3) break;

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":123
 *         start = ps_latnode_times(cnode, NULL, NULL)
 *         while start < self.start or start >= self.end:
 *             self.itor = ps_latnode_iter_next(self.itor)             # <<<<<<<<<<<<<<
 *             if self.itor == NULL:
 *                 raise StopIteration
 */
    ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = ps_latnode_iter_next(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":124
 *         while start < self.start or start >= self.end:
 *             self.itor = ps_latnode_iter_next(self.itor)
 *             if self.itor == NULL:             # <<<<<<<<<<<<<<
 *                 raise StopIteration
 *             cnode = ps_latnode_iter_node(self.itor)
 */
    __pyx_t_3 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
    if (__pyx_t_3) {

      /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":125
 *             self.itor = ps_latnode_iter_next(self.itor)
 *             if self.itor == NULL:
 *                 raise StopIteration             # <<<<<<<<<<<<<<
 *             cnode = ps_latnode_iter_node(self.itor)
 *             start = ps_latnode_times(cnode, NULL, NULL)
 */
      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":126
 *             if self.itor == NULL:
 *                 raise StopIteration
 *             cnode = ps_latnode_iter_node(self.itor)             # <<<<<<<<<<<<<<
 *             start = ps_latnode_times(cnode, NULL, NULL)
 *         node = LatNode()
 */
    __pyx_v_cnode = ps_latnode_iter_node(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":127
 *                 raise StopIteration
 *             cnode = ps_latnode_iter_node(self.itor)
 *             start = ps_latnode_times(cnode, NULL, NULL)             # <<<<<<<<<<<<<<
 *         node = LatNode()
 *         node.set_node(self.dag, cnode)
 */
    __pyx_v_start = ps_latnode_times(__pyx_v_cnode, NULL, NULL);
  }

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":128
 *             cnode = ps_latnode_iter_node(self.itor)
 *             start = ps_latnode_times(cnode, NULL, NULL)
 *         node = LatNode()             # <<<<<<<<<<<<<<
 *         node.set_node(self.dag, cnode)
 *         return node
 */
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":129
 *             start = ps_latnode_times(cnode, NULL, NULL)
 *         node = LatNode()
 *         node.set_node(self.dag, cnode)             # <<<<<<<<<<<<<<
 *         return node
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_12pocketsphinx_LatNode *)__pyx_v_node->__pyx_vtab)->set_node(__pyx_v_node, ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->dag, __pyx_v_cnode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":130
 *         node = LatNode()
 *         node.set_node(self.dag, cnode)
 *         return node             # <<<<<<<<<<<<<<
 * 
 * cdef class LatLink:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_node));
  __pyx_r = ((PyObject *)__pyx_v_node);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":147
 *     @type prob: float
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.link = NULL
 * 
 */

static int __pyx_pf_12pocketsphinx_7LatLink___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_12pocketsphinx_7LatLink___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":148
 *     """
 *     def __cinit__(self):
 *         self.link = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link):
 */
  ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link = NULL;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":150
 *         self.link = NULL
 * 
 *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link):             # <<<<<<<<<<<<<<
 *         """
 *         Internal function - binds this to a PocketSphinx lattice link.
 */

static  PyObject *__pyx_f_12pocketsphinx_7LatLink_set_link(struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_self, ps_lattice_t *__pyx_v_dag, ps_latlink_t *__pyx_v_link) {
  short __pyx_v_sf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("set_link");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":155
 *         """
 *         cdef short sf
 *         self.dag = dag             # <<<<<<<<<<<<<<
 *         self.link = link
 *         self.word = ps_latlink_word(dag, link)
 */
  __pyx_v_self->dag = __pyx_v_dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":156
 *         cdef short sf
 *         self.dag = dag
 *         self.link = link             # <<<<<<<<<<<<<<
 *         self.word = ps_latlink_word(dag, link)
 *         self.baseword = ps_latlink_baseword(dag, link)
 */
  __pyx_v_self->link = __pyx_v_link;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":157
 *         self.dag = dag
 *         self.link = link
 *         self.word = ps_latlink_word(dag, link)             # <<<<<<<<<<<<<<
 *         self.baseword = ps_latlink_baseword(dag, link)
 *         self.ef = ps_latlink_times(link, &sf)
 */
  __pyx_v_self->word = ps_latlink_word(__pyx_v_dag, __pyx_v_link);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":158
 *         self.link = link
 *         self.word = ps_latlink_word(dag, link)
 *         self.baseword = ps_latlink_baseword(dag, link)             # <<<<<<<<<<<<<<
 *         self.ef = ps_latlink_times(link, &sf)
 *         self.sf = sf
 */
  __pyx_v_self->baseword = ps_latlink_baseword(__pyx_v_dag, __pyx_v_link);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":159
 *         self.word = ps_latlink_word(dag, link)
 *         self.baseword = ps_latlink_baseword(dag, link)
 *         self.ef = ps_latlink_times(link, &sf)             # <<<<<<<<<<<<<<
 *         self.sf = sf
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
 */
  __pyx_v_self->ef = ps_latlink_times(__pyx_v_link, (&__pyx_v_sf));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":160
 *         self.baseword = ps_latlink_baseword(dag, link)
 *         self.ef = ps_latlink_times(link, &sf)
 *         self.sf = sf             # <<<<<<<<<<<<<<
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
 *                                          ps_latlink_prob(dag, link, NULL))
 */
  __pyx_v_self->sf = __pyx_v_sf;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":161
 *         self.ef = ps_latlink_times(link, &sf)
 *         self.sf = sf
 *         self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),             # <<<<<<<<<<<<<<
 *                                          ps_latlink_prob(dag, link, NULL))
 * 
 */
  __pyx_v_self->prob = logmath_log_to_ln(ps_lattice_get_logmath(__pyx_v_dag), ps_latlink_prob(__pyx_v_dag, __pyx_v_link, NULL));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":164
 *                                          ps_latlink_prob(dag, link, NULL))
 * 
 *     def nodes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get source and destination nodes for this link.
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7LatLink_nodes[] = "\n        Get source and destination nodes for this link.\n\n        @return: Source and destination nodes for this link\n        @rtype: (LatNode, LatNode)\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_src;
  struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_dest;
  ps_latnode_t *__pyx_v_csrc;
  ps_latnode_t *__pyx_v_cdest;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("nodes");
  __pyx_v_src = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_dest = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":174
 *         cdef ps_latnode_t *csrc, *cdest
 * 
 *         cdest = ps_latlink_nodes(self.link, &csrc)             # <<<<<<<<<<<<<<
 *         src = LatNode()
 *         src.set_node(self.dag, csrc)
 */
  __pyx_v_cdest = ps_latlink_nodes(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link, (&__pyx_v_csrc));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":175
 * 
 *         cdest = ps_latlink_nodes(self.link, &csrc)
 *         src = LatNode()             # <<<<<<<<<<<<<<
 *         src.set_node(self.dag, csrc)
 *         dest = LatNode()
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_src));
  __pyx_v_src = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":176
 *         cdest = ps_latlink_nodes(self.link, &csrc)
 *         src = LatNode()
 *         src.set_node(self.dag, csrc)             # <<<<<<<<<<<<<<
 *         dest = LatNode()
 *         dest.set_node(self.dag, cdest)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_12pocketsphinx_LatNode *)__pyx_v_src->__pyx_vtab)->set_node(__pyx_v_src, ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->dag, __pyx_v_csrc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":177
 *         src = LatNode()
 *         src.set_node(self.dag, csrc)
 *         dest = LatNode()             # <<<<<<<<<<<<<<
 *         dest.set_node(self.dag, cdest)
 *         return src, dest
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_dest));
  __pyx_v_dest = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":178
 *         src.set_node(self.dag, csrc)
 *         dest = LatNode()
 *         dest.set_node(self.dag, cdest)             # <<<<<<<<<<<<<<
 *         return src, dest
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_12pocketsphinx_LatNode *)__pyx_v_dest->__pyx_vtab)->set_node(__pyx_v_dest, ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->dag, __pyx_v_cdest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":179
 *         dest = LatNode()
 *         dest.set_node(self.dag, cdest)
 *         return src, dest             # <<<<<<<<<<<<<<
 * 
 *     def pred(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_src));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_src));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_src));
  __Pyx_INCREF(((PyObject *)__pyx_v_dest));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_dest));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_dest));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatLink.nodes");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_src);
  __Pyx_DECREF((PyObject *)__pyx_v_dest);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":181
 *         return src, dest
 * 
 *     def pred(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get backpointer from this link.
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_pred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7LatLink_pred[] = "\n        Get backpointer from this link.\n\n        @return: Backpointer from this link, set by bestpath search.\n        @rtype: LatLink\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_pred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_pred;
  ps_latlink_t *__pyx_v_cpred;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pred");
  __pyx_v_pred = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":191
 *         cdef ps_latlink_t *cpred
 * 
 *         cpred = ps_latlink_pred(self.link)             # <<<<<<<<<<<<<<
 *         if cpred == NULL:
 *             return None
 */
  __pyx_v_cpred = ps_latlink_pred(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":192
 * 
 *         cpred = ps_latlink_pred(self.link)
 *         if cpred == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         pred = LatLink()
 */
  __pyx_t_1 = (__pyx_v_cpred == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":193
 *         cpred = ps_latlink_pred(self.link)
 *         if cpred == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         pred = LatLink()
 *         pred.set_link(self.dag, cpred)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":194
 *         if cpred == NULL:
 *             return None
 *         pred = LatLink()             # <<<<<<<<<<<<<<
 *         pred.set_link(self.dag, cpred)
 *         return pred
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_pred));
  __pyx_v_pred = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":195
 *             return None
 *         pred = LatLink()
 *         pred.set_link(self.dag, cpred)             # <<<<<<<<<<<<<<
 *         return pred
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_pred->__pyx_vtab)->set_link(__pyx_v_pred, ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->dag, __pyx_v_cpred); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":196
 *         pred = LatLink()
 *         pred.set_link(self.dag, cpred)
 *         return pred             # <<<<<<<<<<<<<<
 * 
 * cdef class LatLinkIterator:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_pred));
  __pyx_r = ((PyObject *)__pyx_v_pred);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pocketsphinx.LatLink.pred");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_pred);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":202
 *     Iterator over word lattice links.
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.itor = NULL
 *         self.first_link = True
 */

static int __pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":203
 *     """
 *     def __cinit__(self):
 *         self.itor = NULL             # <<<<<<<<<<<<<<
 *         self.first_link = True
 * 
 */
  ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor = NULL;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":204
 *     def __cinit__(self):
 *         self.itor = NULL
 *         self.first_link = True             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link = 1;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":206
 *         self.first_link = True
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":207
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":209
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Advance iterator and return the next link.
 */

static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___next__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_12pocketsphinx_15LatLinkIterator___next__[] = "\n        Advance iterator and return the next link.\n\n        @return: Next lattice link in this iterator.\n        @rtype: LatLink\n        ";
struct wrapperbase __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__;
static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___next__(PyObject *__pyx_v_self) {
  struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_link;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__next__");
  __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":217
 *         """
 *         cdef LatLink link
 *         if self.first_link:             # <<<<<<<<<<<<<<
 *             self.first_link = False
 *         else:
 */
  if (((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":218
 *         cdef LatLink link
 *         if self.first_link:
 *             self.first_link = False             # <<<<<<<<<<<<<<
 *         else:
 *             self.itor = ps_latlink_iter_next(self.itor)
 */
    ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":220
 *             self.first_link = False
 *         else:
 *             self.itor = ps_latlink_iter_next(self.itor)             # <<<<<<<<<<<<<<
 *         if self.itor == NULL:
 *             raise StopIteration
 */
    ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor = ps_latlink_iter_next(((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor);
  }
  __pyx_L5:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":221
 *         else:
 *             self.itor = ps_latlink_iter_next(self.itor)
 *         if self.itor == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         link = LatLink()
 */
  __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":222
 *             self.itor = ps_latlink_iter_next(self.itor)
 *         if self.itor == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         link = LatLink()
 *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":223
 *         if self.itor == NULL:
 *             raise StopIteration
 *         link = LatLink()             # <<<<<<<<<<<<<<
 *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))
 *         return link
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_link));
  __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":224
 *             raise StopIteration
 *         link = LatLink()
 *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))             # <<<<<<<<<<<<<<
 *         return link
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_link->__pyx_vtab)->set_link(__pyx_v_link, ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->dag, ps_latlink_iter_link(((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":225
 *         link = LatLink()
 *         link.set_link(self.dag, ps_latlink_iter_link(self.itor))
 *         return link             # <<<<<<<<<<<<<<
 * 
 * cdef class Lattice:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_link));
  __pyx_r = ((PyObject *)__pyx_v_link);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pocketsphinx.LatLinkIterator.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_link);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":254
 *     @type end: LatNode
 *     """
 *     def __init__(self, ps=None, latfile=None, boxed=None):             # <<<<<<<<<<<<<<
 *         self.dag = NULL
 *         if latfile:
 */

static int __pyx_pf_12pocketsphinx_7Lattice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_12pocketsphinx_7Lattice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ps = 0;
  PyObject *__pyx_v_latfile = 0;
  PyObject *__pyx_v_boxed = 0;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ps,&__pyx_n_s__latfile,&__pyx_n_s__boxed,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ps);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__latfile);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__boxed);
        if (value) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_ps = values[0];
    __pyx_v_latfile = values[1];
    __pyx_v_boxed = values[2];
  } else {
    __pyx_v_ps = ((PyObject *)Py_None);
    __pyx_v_latfile = ((PyObject *)Py_None);
    __pyx_v_boxed = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_boxed = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_latfile = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_ps = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Lattice.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":255
 *     """
 *     def __init__(self, ps=None, latfile=None, boxed=None):
 *         self.dag = NULL             # <<<<<<<<<<<<<<
 *         if latfile:
 *             self.read_dag(ps, latfile)
 */
  ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag = NULL;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":256
 *     def __init__(self, ps=None, latfile=None, boxed=None):
 *         self.dag = NULL
 *         if latfile:             # <<<<<<<<<<<<<<
 *             self.read_dag(ps, latfile)
 *         if boxed:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_latfile); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":257
 *         self.dag = NULL
 *         if latfile:
 *             self.read_dag(ps, latfile)             # <<<<<<<<<<<<<<
 *         if boxed:
 *             self.set_boxed(boxed)
 */
    if (!(likely(((__pyx_v_ps) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ps, __pyx_ptype_12pocketsphinx_Decoder))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_Lattice *)((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->__pyx_vtab)->read_dag(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self), ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_ps), __pyx_v_latfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":258
 *         if latfile:
 *             self.read_dag(ps, latfile)
 *         if boxed:             # <<<<<<<<<<<<<<
 *             self.set_boxed(boxed)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_boxed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":259
 *             self.read_dag(ps, latfile)
 *         if boxed:
 *             self.set_boxed(boxed)             # <<<<<<<<<<<<<<
 * 
 *     cdef read_dag(Lattice self, Decoder ps, latfile):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_Lattice *)((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->__pyx_vtab)->set_boxed(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self), __pyx_v_boxed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pocketsphinx.Lattice.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":261
 *             self.set_boxed(boxed)
 * 
 *     cdef read_dag(Lattice self, Decoder ps, latfile):             # <<<<<<<<<<<<<<
 *         if ps:
 *             self.dag = ps_lattice_read(ps.ps, latfile)
 */

static  PyObject *__pyx_f_12pocketsphinx_7Lattice_read_dag(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, struct __pyx_obj_12pocketsphinx_Decoder *__pyx_v_ps, PyObject *__pyx_v_latfile) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_dag");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":262
 * 
 *     cdef read_dag(Lattice self, Decoder ps, latfile):
 *         if ps:             # <<<<<<<<<<<<<<
 *             self.dag = ps_lattice_read(ps.ps, latfile)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ps)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":263
 *     cdef read_dag(Lattice self, Decoder ps, latfile):
 *         if ps:
 *             self.dag = ps_lattice_read(ps.ps, latfile)             # <<<<<<<<<<<<<<
 *         else:
 *             self.dag = ps_lattice_read(NULL, latfile)
 */
    __pyx_t_2 = PyBytes_AsString(__pyx_v_latfile); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->dag = ps_lattice_read(__pyx_v_ps->ps, __pyx_t_2);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":265
 *             self.dag = ps_lattice_read(ps.ps, latfile)
 *         else:
 *             self.dag = ps_lattice_read(NULL, latfile)             # <<<<<<<<<<<<<<
 *         self.n_frames = ps_lattice_n_frames(self.dag)
 *         if self.dag == NULL:
 */
    __pyx_t_2 = PyBytes_AsString(__pyx_v_latfile); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->dag = ps_lattice_read(NULL, __pyx_t_2);
  }
  __pyx_L3:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":266
 *         else:
 *             self.dag = ps_lattice_read(NULL, latfile)
 *         self.n_frames = ps_lattice_n_frames(self.dag)             # <<<<<<<<<<<<<<
 *         if self.dag == NULL:
 *             raise RuntimeError, "Failed to read lattice from %s" % latfile
 */
  __pyx_t_3 = PyInt_FromLong(ps_lattice_n_frames(__pyx_v_self->dag)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->n_frames);
  __Pyx_DECREF(__pyx_v_self->n_frames);
  __pyx_v_self->n_frames = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":267
 *             self.dag = ps_lattice_read(NULL, latfile)
 *         self.n_frames = ps_lattice_n_frames(self.dag)
 *         if self.dag == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to read lattice from %s" % latfile
 * 
 */
  __pyx_t_1 = (__pyx_v_self->dag == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":268
 *         self.n_frames = ps_lattice_n_frames(self.dag)
 *         if self.dag == NULL:
 *             raise RuntimeError, "Failed to read lattice from %s" % latfile             # <<<<<<<<<<<<<<
 * 
 *     cdef set_dag(Lattice self, ps_lattice_t *dag):
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_latfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), 0);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pocketsphinx.Lattice.read_dag");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":270
 *             raise RuntimeError, "Failed to read lattice from %s" % latfile
 * 
 *     cdef set_dag(Lattice self, ps_lattice_t *dag):             # <<<<<<<<<<<<<<
 *         ps_lattice_retain(dag)
 *         ps_lattice_free(self.dag)
 */

static  PyObject *__pyx_f_12pocketsphinx_7Lattice_set_dag(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, ps_lattice_t *__pyx_v_dag) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_dag");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":271
 * 
 *     cdef set_dag(Lattice self, ps_lattice_t *dag):
 *         ps_lattice_retain(dag)             # <<<<<<<<<<<<<<
 *         ps_lattice_free(self.dag)
 *         self.dag = dag
 */
  ps_lattice_retain(__pyx_v_dag);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":272
 *     cdef set_dag(Lattice self, ps_lattice_t *dag):
 *         ps_lattice_retain(dag)
 *         ps_lattice_free(self.dag)             # <<<<<<<<<<<<<<
 *         self.dag = dag
 *         self.n_frames = ps_lattice_n_frames(dag)
 */
  ps_lattice_free(__pyx_v_self->dag);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":273
 *         ps_lattice_retain(dag)
 *         ps_lattice_free(self.dag)
 *         self.dag = dag             # <<<<<<<<<<<<<<
 *         self.n_frames = ps_lattice_n_frames(dag)
 * 
 */
  __pyx_v_self->dag = __pyx_v_dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":274
 *         ps_lattice_free(self.dag)
 *         self.dag = dag
 *         self.n_frames = ps_lattice_n_frames(dag)             # <<<<<<<<<<<<<<
 * 
 *     cdef set_boxed(Lattice self, box):
 */
  __pyx_t_1 = PyInt_FromLong(ps_lattice_n_frames(__pyx_v_dag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->n_frames);
  __Pyx_DECREF(__pyx_v_self->n_frames);
  __pyx_v_self->n_frames = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Lattice.set_dag");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":276
 *         self.n_frames = ps_lattice_n_frames(dag)
 * 
 *     cdef set_boxed(Lattice self, box):             # <<<<<<<<<<<<<<
 *         cdef ps_lattice_t *dag
 *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
 */

static  PyObject *__pyx_f_12pocketsphinx_7Lattice_set_boxed(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, PyObject *__pyx_v_box) {
  ps_lattice_t *__pyx_v_dag;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_boxed");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":278
 *     cdef set_boxed(Lattice self, box):
 *         cdef ps_lattice_t *dag
 *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed             # <<<<<<<<<<<<<<
 *         ps_lattice_retain(dag)
 *         ps_lattice_free(self.dag)
 */
  __pyx_v_dag = ((ps_lattice_t *)((PyGBoxed *)__pyx_v_box)->boxed);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":279
 *         cdef ps_lattice_t *dag
 *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
 *         ps_lattice_retain(dag)             # <<<<<<<<<<<<<<
 *         ps_lattice_free(self.dag)
 *         self.dag = dag
 */
  ps_lattice_retain(__pyx_v_dag);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":280
 *         dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
 *         ps_lattice_retain(dag)
 *         ps_lattice_free(self.dag)             # <<<<<<<<<<<<<<
 *         self.dag = dag
 *         self.n_frames = ps_lattice_n_frames(self.dag)
 */
  ps_lattice_free(__pyx_v_self->dag);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":281
 *         ps_lattice_retain(dag)
 *         ps_lattice_free(self.dag)
 *         self.dag = dag             # <<<<<<<<<<<<<<
 *         self.n_frames = ps_lattice_n_frames(self.dag)
 * 
 */
  __pyx_v_self->dag = __pyx_v_dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":282
 *         ps_lattice_free(self.dag)
 *         self.dag = dag
 *         self.n_frames = ps_lattice_n_frames(self.dag)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyInt_FromLong(ps_lattice_n_frames(__pyx_v_self->dag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->n_frames);
  __Pyx_DECREF(__pyx_v_self->n_frames);
  __pyx_v_self->n_frames = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Lattice.set_boxed");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":284
 *         self.n_frames = ps_lattice_n_frames(self.dag)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         ps_lattice_free(self.dag)
 * 
 */

static void __pyx_pf_12pocketsphinx_7Lattice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_12pocketsphinx_7Lattice___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":285
 * 
 *     def __dealloc__(self):
 *         ps_lattice_free(self.dag)             # <<<<<<<<<<<<<<
 * 
 *     def bestpath(self, NGramModel lmset, float lwf, float ascale):
 */
  ps_lattice_free(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);

  __Pyx_RefNannyFinishContext();
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":287
 *         ps_lattice_free(self.dag)
 * 
 *     def bestpath(self, NGramModel lmset, float lwf, float ascale):             # <<<<<<<<<<<<<<
 *         """
 *         Find the best path through the lattice, optionally using a
 */

static PyObject *__pyx_pf_12pocketsphinx_7Lattice_bestpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Lattice_bestpath[] = "\n        Find the best path through the lattice, optionally using a\n        language model.\n\n        This function performs best-path search on the lattice, and\n        returns the final link in the best path found.  The existing\n        acoustic scores on the lattice links are used in conjunction\n        with an optional language model.  A scaling factor can be\n        applied to the acoustic scores to produce more useful\n        posterior probabilities (in conjunction with C{posterior()},\n        below).\n\n        @param lmset: Language model (set) to use for rescoring\n        @type lmset: sphinxbase.NGramModel\n        @param lwf: Weight to apply to language model scores (on top\n        of any existing language model weight set in C{lmset}).\n        @type lwf: float\n        @param ascale: Weight to apply to acoustic model scores.\n        @type ascale: float\n        @return: Final link in best path.\n        @rtype: LatLink\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Lattice_bestpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lmset = 0;
  float __pyx_v_lwf;
  float __pyx_v_ascale;
  ps_latlink_t *__pyx_v_end;
  struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_link;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lmset,&__pyx_n_s__lwf,&__pyx_n_s__ascale,0};
  __Pyx_RefNannySetupContext("bestpath");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lmset);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lwf);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascale);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "bestpath") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)values[0]);
    __pyx_v_lwf = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_lwf == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ascale = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_lwf = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_lwf == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ascale = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Lattice.bestpath");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lmset), __pyx_ptype_10sphinxbase_NGramModel, 1, "lmset", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":312
 *         cdef ps_latlink_t *end
 *         cdef LatLink link
 *         end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)             # <<<<<<<<<<<<<<
 *         link = LatLink()
 *         link.set_link(self.dag, end)
 */
  __pyx_v_end = ps_lattice_bestpath(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_v_lmset->lm, __pyx_v_lwf, __pyx_v_ascale);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":313
 *         cdef LatLink link
 *         end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)
 *         link = LatLink()             # <<<<<<<<<<<<<<
 *         link.set_link(self.dag, end)
 *         return link
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatLink)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_link));
  __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":314
 *         end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)
 *         link = LatLink()
 *         link.set_link(self.dag, end)             # <<<<<<<<<<<<<<
 *         return link
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_12pocketsphinx_LatLink *)__pyx_v_link->__pyx_vtab)->set_link(__pyx_v_link, ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":315
 *         link = LatLink()
 *         link.set_link(self.dag, end)
 *         return link             # <<<<<<<<<<<<<<
 * 
 *     def posterior(self, NGramModel lmset, float ascale):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_link));
  __pyx_r = ((PyObject *)__pyx_v_link);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Lattice.bestpath");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_link);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":317
 *         return link
 * 
 *     def posterior(self, NGramModel lmset, float ascale):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate posterior probabilities of all links in a lattice.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Lattice_posterior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Lattice_posterior[] = "\n        Calculate posterior probabilities of all links in a lattice.\n\n        This function performs the backward part of forward-backward\n        calculation of posterior probabilities for all links in the\n        lattice.  It assumes that C{bestpath()} has already been\n        called on the lattice.\n\n        @param lmset: Language model (set) to use for rescoring\n        @type lmset: sphinxbase.NGramModel\n        @param ascale: Weight to apply to acoustic model scores.\n        @type ascale: float\n        @return: Log-probability of the lattice as a whole.\n        @rtype: float\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Lattice_posterior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lmset = 0;
  float __pyx_v_ascale;
  logmath_t *__pyx_v_lmath;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lmset,&__pyx_n_s__ascale,0};
  __Pyx_RefNannySetupContext("posterior");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lmset);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascale);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("posterior", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "posterior") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)values[0]);
    __pyx_v_ascale = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_ascale = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_ascale == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("posterior", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Lattice.posterior");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lmset), __pyx_ptype_10sphinxbase_NGramModel, 1, "lmset", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":334
 *         """
 *         cdef logmath_t *lmath
 *         lmath = ps_lattice_get_logmath(self.dag)             # <<<<<<<<<<<<<<
 *         return sb.logmath_log_to_ln(lmath,
 *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))
 */
  __pyx_v_lmath = ps_lattice_get_logmath(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":335
 *         cdef logmath_t *lmath
 *         lmath = ps_lattice_get_logmath(self.dag)
 *         return sb.logmath_log_to_ln(lmath,             # <<<<<<<<<<<<<<
 *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":336
 *         lmath = ps_lattice_get_logmath(self.dag)
 *         return sb.logmath_log_to_ln(lmath,
 *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))             # <<<<<<<<<<<<<<
 * 
 *     def nodes(self, start=0, end=-1):
 */
  __pyx_t_1 = PyFloat_FromDouble(logmath_log_to_ln(__pyx_v_lmath, ps_lattice_posterior(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_v_lmset->lm, __pyx_v_ascale))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Lattice.posterior");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":338
 *                                     ps_lattice_posterior(self.dag, lmset.lm, ascale))
 * 
 *     def nodes(self, start=0, end=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Get an iterator over all nodes in the lattice.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Lattice_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Lattice_nodes[] = "\n        Get an iterator over all nodes in the lattice.\n\n        @param start: First frame to iterate over.\n        @type start: int\n        @param end: Last frame to iterate over, or -1 for all remaining\n        @type end: int\n        @return: Iterator over nodes.\n        @rtype: LatNodeIterator\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Lattice_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_end = 0;
  struct __pyx_obj_12pocketsphinx_LatNodeIterator *__pyx_v_itor;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
  __Pyx_RefNannySetupContext("nodes");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)__pyx_int_neg_1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
        if (value) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "nodes") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_start = values[0];
    __pyx_v_end = values[1];
  } else {
    __pyx_v_start = ((PyObject *)__pyx_int_0);
    __pyx_v_end = ((PyObject *)__pyx_int_neg_1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nodes", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Lattice.nodes");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_end);
  __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":351
 *         cdef LatNodeIterator itor
 * 
 *         if end == -1:             # <<<<<<<<<<<<<<
 *             end = ps_lattice_n_frames(self.dag)
 *         itor = LatNodeIterator(start, end)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":352
 * 
 *         if end == -1:
 *             end = ps_lattice_n_frames(self.dag)             # <<<<<<<<<<<<<<
 *         itor = LatNodeIterator(start, end)
 *         itor.dag = self.dag
 */
    __pyx_t_1 = PyInt_FromLong(ps_lattice_n_frames(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_end);
    __pyx_v_end = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":353
 *         if end == -1:
 *             end = ps_lattice_n_frames(self.dag)
 *         itor = LatNodeIterator(start, end)             # <<<<<<<<<<<<<<
 *         itor.dag = self.dag
 *         itor.itor = ps_latnode_iter(self.dag)
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_start);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start);
  __Pyx_GIVEREF(__pyx_v_start);
  __Pyx_INCREF(__pyx_v_end);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end);
  __Pyx_GIVEREF(__pyx_v_end);
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_LatNodeIterator)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_itor));
  __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":354
 *             end = ps_lattice_n_frames(self.dag)
 *         itor = LatNodeIterator(start, end)
 *         itor.dag = self.dag             # <<<<<<<<<<<<<<
 *         itor.itor = ps_latnode_iter(self.dag)
 *         return itor
 */
  __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":355
 *         itor = LatNodeIterator(start, end)
 *         itor.dag = self.dag
 *         itor.itor = ps_latnode_iter(self.dag)             # <<<<<<<<<<<<<<
 *         return itor
 * 
 */
  __pyx_v_itor->itor = ps_latnode_iter(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":356
 *         itor.dag = self.dag
 *         itor.itor = ps_latnode_iter(self.dag)
 *         return itor             # <<<<<<<<<<<<<<
 * 
 *     def write(self, outfile):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_itor));
  __pyx_r = ((PyObject *)__pyx_v_itor);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pocketsphinx.Lattice.nodes");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_itor);
  __Pyx_DECREF(__pyx_v_end);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":358
 *         return itor
 * 
 *     def write(self, outfile):             # <<<<<<<<<<<<<<
 *         """
 *         Write the lattice to an output file.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Lattice_write(PyObject *__pyx_v_self, PyObject *__pyx_v_outfile); /*proto*/
static char __pyx_doc_12pocketsphinx_7Lattice_write[] = "\n        Write the lattice to an output file.\n\n        @param outfile: Name of file to write to.\n        @type outfile: str        \n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Lattice_write(PyObject *__pyx_v_self, PyObject *__pyx_v_outfile) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("write");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":367
 *         cdef int rv
 * 
 *         rv = ps_lattice_write(self.dag, outfile)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise RuntimeError, "Failed to write lattice to %s" % outfile
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_outfile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_rv = ps_lattice_write(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_t_1);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":368
 * 
 *         rv = ps_lattice_write(self.dag, outfile)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to write lattice to %s" % outfile
 * 
 */
  __pyx_t_2 = (__pyx_v_rv < 0);
  if (__pyx_t_2) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":369
 *         rv = ps_lattice_write(self.dag, outfile)
 *         if rv < 0:
 *             raise RuntimeError, "Failed to write lattice to %s" % outfile             # <<<<<<<<<<<<<<
 * 
 * cdef class Decoder:
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_v_outfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), 0);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pocketsphinx.Lattice.write");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":399
 *     @type jsgf str
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef cmd_ln_t *config
 *         cdef int i
 */

static int __pyx_pf_12pocketsphinx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_12pocketsphinx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kwargs = 0;
  cmd_ln_t *__pyx_v_config;
  int __pyx_v_i;
  PyObject *__pyx_v_k;
  PyObject *__pyx_v_v;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  void *__pyx_t_5;
  void *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":404
 * 
 *         # Construct from an existing GObject pointer if given
 *         if 'boxed' in kwargs:             # <<<<<<<<<<<<<<
 *             self.argc = 0
 *             self.set_boxed(kwargs['boxed'])
 */
  if (unlikely(((PyObject *)__pyx_v_kwargs) == Py_None)) {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  } else {
    __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__boxed)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":405
 *         # Construct from an existing GObject pointer if given
 *         if 'boxed' in kwargs:
 *             self.argc = 0             # <<<<<<<<<<<<<<
 *             self.set_boxed(kwargs['boxed'])
 *             return
 */
    ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = 0;

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":406
 *         if 'boxed' in kwargs:
 *             self.argc = 0
 *             self.set_boxed(kwargs['boxed'])             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__boxed)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((struct __pyx_vtabstruct_12pocketsphinx_Decoder *)((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->__pyx_vtab)->set_boxed(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":407
 *             self.argc = 0
 *             self.set_boxed(kwargs['boxed'])
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # A much more concise version of what pocketsphinx_parse_argdict used to do
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":410
 * 
 *         # A much more concise version of what pocketsphinx_parse_argdict used to do
 *         self.argc = len(kwargs) * 2             # <<<<<<<<<<<<<<
 *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
 *         i = 0
 */
  if (unlikely(__pyx_v_kwargs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_4 = PyDict_Size(((PyObject *)__pyx_v_kwargs)); 
  ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = (__pyx_t_4 * 2);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":411
 *         # A much more concise version of what pocketsphinx_parse_argdict used to do
 *         self.argc = len(kwargs) * 2
 *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))             # <<<<<<<<<<<<<<
 *         i = 0
 *         for k, v in kwargs.iteritems():
 */
  ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv = ((char **)ckd_calloc(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc, (sizeof(char *))));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":412
 *         self.argc = len(kwargs) * 2
 *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
 *         i = 0             # <<<<<<<<<<<<<<
 *         for k, v in kwargs.iteritems():
 *             if k[0] != '-':
 */
  __pyx_v_i = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":413
 *         self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
 *         i = 0
 *         for k, v in kwargs.iteritems():             # <<<<<<<<<<<<<<
 *             if k[0] != '-':
 *                 k = '-' + k
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
  __Pyx_XDECREF(__pyx_t_3);
  __pyx_t_3 = ((PyObject *)__pyx_v_kwargs);
  __pyx_t_4 = 0;
  while (1) {
    if (!PyDict_Next(__pyx_t_3, (&__pyx_t_4), ((PyObject **)(&__pyx_t_5)), ((PyObject **)(&__pyx_t_6)))) break;
    __Pyx_INCREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(__pyx_v_k);
    __pyx_v_k = ((PyObject *)__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(__pyx_v_v);
    __pyx_v_v = ((PyObject *)__pyx_t_6);

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":414
 *         i = 0
 *         for k, v in kwargs.iteritems():
 *             if k[0] != '-':             # <<<<<<<<<<<<<<
 *                 k = '-' + k
 *             self.argv[i] = sb.ckd_salloc(k)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_k, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_3), Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_1) {

      /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":415
 *         for k, v in kwargs.iteritems():
 *             if k[0] != '-':
 *                 k = '-' + k             # <<<<<<<<<<<<<<
 *             self.argv[i] = sb.ckd_salloc(k)
 *             self.argv[i+1] = sb.ckd_salloc(v)
 */
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_3), __pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_v_k);
      __pyx_v_k = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":416
 *             if k[0] != '-':
 *                 k = '-' + k
 *             self.argv[i] = sb.ckd_salloc(k)             # <<<<<<<<<<<<<<
 *             self.argv[i+1] = sb.ckd_salloc(v)
 *             i = i + 2
 */
    __pyx_t_8 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[__pyx_v_i]) = ckd_salloc(__pyx_t_8);

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":417
 *                 k = '-' + k
 *             self.argv[i] = sb.ckd_salloc(k)
 *             self.argv[i+1] = sb.ckd_salloc(v)             # <<<<<<<<<<<<<<
 *             i = i + 2
 *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
 */
    __pyx_t_8 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[(__pyx_v_i + 1)]) = ckd_salloc(__pyx_t_8);

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":418
 *             self.argv[i] = sb.ckd_salloc(k)
 *             self.argv[i+1] = sb.ckd_salloc(v)
 *             i = i + 2             # <<<<<<<<<<<<<<
 *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
 *         if config == NULL:
 */
    __pyx_v_i = (__pyx_v_i + 2);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":419
 *             self.argv[i+1] = sb.ckd_salloc(v)
 *             i = i + 2
 *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)             # <<<<<<<<<<<<<<
 *         if config == NULL:
 *             raise RuntimeError, "Failed to parse argument list"
 */
  __pyx_v_config = cmd_ln_parse_r(NULL, ps_args(), ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc, ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv, 0);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":420
 *             i = i + 2
 *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
 *         if config == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to parse argument list"
 *         self.ps = ps_init(config)
 */
  __pyx_t_1 = (__pyx_v_config == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":421
 *         config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
 *         if config == NULL:
 *             raise RuntimeError, "Failed to parse argument list"             # <<<<<<<<<<<<<<
 *         self.ps = ps_init(config)
 *         if self.ps == NULL:
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_4), 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":422
 *         if config == NULL:
 *             raise RuntimeError, "Failed to parse argument list"
 *         self.ps = ps_init(config)             # <<<<<<<<<<<<<<
 *         if self.ps == NULL:
 *             raise RuntimeError, "Failed to initialize PocketSphinx"
 */
  ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps = ps_init(__pyx_v_config);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":423
 *             raise RuntimeError, "Failed to parse argument list"
 *         self.ps = ps_init(config)
 *         if self.ps == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to initialize PocketSphinx"
 * 
 */
  __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":424
 *         self.ps = ps_init(config)
 *         if self.ps == NULL:
 *             raise RuntimeError, "Failed to initialize PocketSphinx"             # <<<<<<<<<<<<<<
 * 
 *     cdef set_boxed(Decoder self, box):
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_5), 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pocketsphinx.Decoder.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_DECREF(__pyx_v_k);
  __Pyx_DECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":426
 *             raise RuntimeError, "Failed to initialize PocketSphinx"
 * 
 *     cdef set_boxed(Decoder self, box):             # <<<<<<<<<<<<<<
 *         cdef ps_decoder_t *ps
 *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
 */

static  PyObject *__pyx_f_12pocketsphinx_7Decoder_set_boxed(struct __pyx_obj_12pocketsphinx_Decoder *__pyx_v_self, PyObject *__pyx_v_box) {
  ps_decoder_t *__pyx_v_ps;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("set_boxed");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":428
 *     cdef set_boxed(Decoder self, box):
 *         cdef ps_decoder_t *ps
 *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed             # <<<<<<<<<<<<<<
 *         ps_retain(ps)
 *         ps_free(self.ps)
 */
  __pyx_v_ps = ((ps_decoder_t *)((PyGBoxed *)__pyx_v_box)->boxed);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":429
 *         cdef ps_decoder_t *ps
 *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
 *         ps_retain(ps)             # <<<<<<<<<<<<<<
 *         ps_free(self.ps)
 *         self.ps = ps
 */
  ps_retain(__pyx_v_ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":430
 *         ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
 *         ps_retain(ps)
 *         ps_free(self.ps)             # <<<<<<<<<<<<<<
 *         self.ps = ps
 * 
 */
  ps_free(__pyx_v_self->ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":431
 *         ps_retain(ps)
 *         ps_free(self.ps)
 *         self.ps = ps             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->ps = __pyx_v_ps;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":433
 *         self.ps = ps
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         ps_free(self.ps)
 *         for i from 0 <= i < self.argc:
 */

static void __pyx_pf_12pocketsphinx_7Decoder___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_12pocketsphinx_7Decoder___dealloc__(PyObject *__pyx_v_self) {
  long __pyx_v_i;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":434
 * 
 *     def __dealloc__(self):
 *         ps_free(self.ps)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < self.argc:
 *             sb.ckd_free(self.argv[i])
 */
  ps_free(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":435
 *     def __dealloc__(self):
 *         ps_free(self.ps)
 *         for i from 0 <= i < self.argc:             # <<<<<<<<<<<<<<
 *             sb.ckd_free(self.argv[i])
 *         sb.ckd_free(self.argv)
 */
  __pyx_t_1 = ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":436
 *         ps_free(self.ps)
 *         for i from 0 <= i < self.argc:
 *             sb.ckd_free(self.argv[i])             # <<<<<<<<<<<<<<
 *         sb.ckd_free(self.argv)
 *         self.argv = NULL
 */
    ckd_free((((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[__pyx_v_i]));
  }

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":437
 *         for i from 0 <= i < self.argc:
 *             sb.ckd_free(self.argv[i])
 *         sb.ckd_free(self.argv)             # <<<<<<<<<<<<<<
 *         self.argv = NULL
 *         self.argc = 0
 */
  ckd_free(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":438
 *             sb.ckd_free(self.argv[i])
 *         sb.ckd_free(self.argv)
 *         self.argv = NULL             # <<<<<<<<<<<<<<
 *         self.argc = 0
 * 
 */
  ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv = NULL;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":439
 *         sb.ckd_free(self.argv)
 *         self.argv = NULL
 *         self.argc = 0             # <<<<<<<<<<<<<<
 * 
 *     def decode_raw(self, fh, uttid=None, maxsamps=-1):
 */
  ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = 0;

  __Pyx_RefNannyFinishContext();
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":441
 *         self.argc = 0
 * 
 *     def decode_raw(self, fh, uttid=None, maxsamps=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Decode raw audio from a file.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_decode_raw[] = "\n        Decode raw audio from a file.\n\n        @param fh: Filehandle to read audio from.\n        @type fh: file\n        @param uttid: Identifier to give to this utterance.\n        @type uttid: str\n        @param maxsamps: Maximum number of samples to read.  If not\n        specified or -1, the rest of the file will be read.\n        @type maxsamps: int\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fh = 0;
  PyObject *__pyx_v_uttid = 0;
  PyObject *__pyx_v_maxsamps = 0;
  FILE *__pyx_v_cfh;
  char *__pyx_v_cuttid;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char *__pyx_t_3;
  long __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fh,&__pyx_n_s__uttid,&__pyx_n_s__maxsamps,0};
  __Pyx_RefNannySetupContext("decode_raw");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_neg_1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fh);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxsamps);
        if (value) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "decode_raw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_fh = values[0];
    __pyx_v_uttid = values[1];
    __pyx_v_maxsamps = values[2];
  } else {
    __pyx_v_uttid = ((PyObject *)Py_None);
    __pyx_v_maxsamps = ((PyObject *)__pyx_int_neg_1);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_maxsamps = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_fh = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decode_raw", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.decode_raw");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":457
 *         cdef char *cuttid
 * 
 *         cfh = PyFile_AsFile(fh)             # <<<<<<<<<<<<<<
 *         if uttid == None:
 *             cuttid = NULL
 */
  __pyx_v_cfh = PyFile_AsFile(__pyx_v_fh);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":458
 * 
 *         cfh = PyFile_AsFile(fh)
 *         if uttid == None:             # <<<<<<<<<<<<<<
 *             cuttid = NULL
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_uttid, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":459
 *         cfh = PyFile_AsFile(fh)
 *         if uttid == None:
 *             cuttid = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             cuttid = uttid
 */
    __pyx_v_cuttid = NULL;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":461
 *             cuttid = NULL
 *         else:
 *             cuttid = uttid             # <<<<<<<<<<<<<<
 *         return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)
 * 
 */
    __pyx_t_3 = PyBytes_AsString(__pyx_v_uttid); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_cuttid = __pyx_t_3;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":462
 *         else:
 *             cuttid = uttid
 *         return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)             # <<<<<<<<<<<<<<
 * 
 *     def decode_senscr(self, fh, uttid=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_v_maxsamps); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromLong(ps_decode_raw(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cfh, __pyx_v_cuttid, __pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Decoder.decode_raw");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":464
 *         return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)
 * 
 *     def decode_senscr(self, fh, uttid=None):             # <<<<<<<<<<<<<<
 *         """
 *         Decode senone scores from a file.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_senscr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_decode_senscr[] = "\n        Decode senone scores from a file.\n\n        @param fh: Filehandle to read senone scores from.\n        @type fh: file\n        @param uttid: Identifier to give to this utterance.\n        @type uttid: str\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_senscr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fh = 0;
  PyObject *__pyx_v_uttid = 0;
  FILE *__pyx_v_cfh;
  char *__pyx_v_cuttid;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char *__pyx_t_3;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fh,&__pyx_n_s__uttid,0};
  __Pyx_RefNannySetupContext("decode_senscr");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fh);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
        if (value) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "decode_senscr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_fh = values[0];
    __pyx_v_uttid = values[1];
  } else {
    __pyx_v_uttid = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_fh = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decode_senscr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.decode_senscr");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":476
 *         cdef char *cuttid
 * 
 *         cfh = PyFile_AsFile(fh)             # <<<<<<<<<<<<<<
 *         if uttid == None:
 *             cuttid = NULL
 */
  __pyx_v_cfh = PyFile_AsFile(__pyx_v_fh);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":477
 * 
 *         cfh = PyFile_AsFile(fh)
 *         if uttid == None:             # <<<<<<<<<<<<<<
 *             cuttid = NULL
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_uttid, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":478
 *         cfh = PyFile_AsFile(fh)
 *         if uttid == None:
 *             cuttid = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             cuttid = uttid
 */
    __pyx_v_cuttid = NULL;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":480
 *             cuttid = NULL
 *         else:
 *             cuttid = uttid             # <<<<<<<<<<<<<<
 *         return ps_decode_senscr(self.ps, cfh, cuttid)
 * 
 */
    __pyx_t_3 = PyBytes_AsString(__pyx_v_uttid); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_cuttid = __pyx_t_3;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":481
 *         else:
 *             cuttid = uttid
 *         return ps_decode_senscr(self.ps, cfh, cuttid)             # <<<<<<<<<<<<<<
 * 
 *     def start_utt(self, uttid=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ps_decode_senscr(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cfh, __pyx_v_cuttid)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Decoder.decode_senscr");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":483
 *         return ps_decode_senscr(self.ps, cfh, cuttid)
 * 
 *     def start_utt(self, uttid=None):             # <<<<<<<<<<<<<<
 *         """
 *         Prepare the decoder to recognize an utterance.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_start_utt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_start_utt[] = "\n        Prepare the decoder to recognize an utterance.\n\n        @param uttid: Identifier to give to this utterance.\n        @type uttid: str\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_start_utt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_uttid = 0;
  char *__pyx_v_cuttid;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char *__pyx_t_3;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__uttid,0};
  __Pyx_RefNannySetupContext("start_utt");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
        if (value) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "start_utt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_uttid = values[0];
  } else {
    __pyx_v_uttid = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start_utt", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.start_utt");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":492
 *         cdef char *cuttid
 * 
 *         if uttid == None:             # <<<<<<<<<<<<<<
 *             cuttid = NULL
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_uttid, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":493
 * 
 *         if uttid == None:
 *             cuttid = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             cuttid = uttid
 */
    __pyx_v_cuttid = NULL;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":495
 *             cuttid = NULL
 *         else:
 *             cuttid = uttid             # <<<<<<<<<<<<<<
 *         if ps_start_utt(self.ps, cuttid) < 0:
 *             raise RuntimeError, "Failed to start utterance processing"
 */
    __pyx_t_3 = PyBytes_AsString(__pyx_v_uttid); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_cuttid = __pyx_t_3;
  }
  __pyx_L6:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":496
 *         else:
 *             cuttid = uttid
 *         if ps_start_utt(self.ps, cuttid) < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to start utterance processing"
 * 
 */
  __pyx_t_2 = (ps_start_utt(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cuttid) < 0);
  if (__pyx_t_2) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":497
 *             cuttid = uttid
 *         if ps_start_utt(self.ps, cuttid) < 0:
 *             raise RuntimeError, "Failed to start utterance processing"             # <<<<<<<<<<<<<<
 * 
 *     def process_raw(self, data, no_search=False, full_utt=False):
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_6), 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Decoder.start_utt");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":499
 *             raise RuntimeError, "Failed to start utterance processing"
 * 
 *     def process_raw(self, data, no_search=False, full_utt=False):             # <<<<<<<<<<<<<<
 *         """
 *         Process (decode) some audio data.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_process_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_process_raw[] = "\n        Process (decode) some audio data.\n\n        @param data: Audio data to process.  This is packed binary\n        data, which consists of single-channel, 16-bit PCM audio, at\n        the sample rate specified when the decoder was initialized.\n        @type data: str\n        @param no_search: Buffer the data without actually processing it (default is to process the\n        data as it is received).\n        @type no_search: bool\n        @param full_utt: This block of data is an entire utterance.\n        Processing an entire utterance at once may improve\n        recognition, particularly for the first utterance passed to\n        the decoder.\n        @type full_utt: bool\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_process_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_no_search = 0;
  PyObject *__pyx_v_full_utt = 0;
  Py_ssize_t __pyx_v_len;
  char *__pyx_v_strdata;
  int16 * __pyx_v_cdata;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__no_search,&__pyx_n_s__full_utt,0};
  __Pyx_RefNannySetupContext("process_raw");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_7;
    values[2] = __pyx_k_8;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__no_search);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__full_utt);
        if (value) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "process_raw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_data = values[0];
    __pyx_v_no_search = values[1];
    __pyx_v_full_utt = values[2];
  } else {
    __pyx_v_no_search = __pyx_k_7;
    __pyx_v_full_utt = __pyx_k_8;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_full_utt = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_no_search = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("process_raw", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.process_raw");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":520
 *         cdef raw_data_ptr cdata
 * 
 *         PyString_AsStringAndSize(data, &strdata, &len)             # <<<<<<<<<<<<<<
 *         cdata = strdata
 *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
 */
  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_data, (&__pyx_v_strdata), (&__pyx_v_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":521
 * 
 *         PyString_AsStringAndSize(data, &strdata, &len)
 *         cdata = strdata             # <<<<<<<<<<<<<<
 *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
 *             raise RuntimeError, "Failed to process %d samples of audio data" % len
 */
  __pyx_v_cdata = __pyx_v_strdata;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":522
 *         PyString_AsStringAndSize(data, &strdata, &len)
 *         cdata = strdata
 *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to process %d samples of audio data" % len
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_no_search); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_full_utt); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (ps_process_raw(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cdata, __pyx_v_len, __pyx_t_1, __pyx_t_2) < 0);
  if (__pyx_t_3) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":523
 *         cdata = strdata
 *         if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
 *             raise RuntimeError, "Failed to process %d samples of audio data" % len             # <<<<<<<<<<<<<<
 * 
 *     def ps_end_utt(self):
 */
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), 0);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pocketsphinx.Decoder.process_raw");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":525
 *             raise RuntimeError, "Failed to process %d samples of audio data" % len
 * 
 *     def ps_end_utt(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finish processing an utterance.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_ps_end_utt[] = "\n        Finish processing an utterance.\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("ps_end_utt");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":529
 *         Finish processing an utterance.
 *         """
 *         if ps_end_utt(self.ps) < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to stop utterance processing"
 * 
 */
  __pyx_t_1 = (ps_end_utt(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps) < 0);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":530
 *         """
 *         if ps_end_utt(self.ps) < 0:
 *             raise RuntimeError, "Failed to stop utterance processing"             # <<<<<<<<<<<<<<
 * 
 *     def get_hyp(self):
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_10), 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.ps_end_utt");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":532
 *             raise RuntimeError, "Failed to stop utterance processing"
 * 
 *     def get_hyp(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get a hypothesis string.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_hyp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_get_hyp[] = "\n        Get a hypothesis string.\n\n        This function returns the text which has been recognized so\n        far, or, if C{ps_end_utt()} has been called, the final\n        recognition result.\n\n        @return: Hypothesis string, utterance ID, recognition score\n        @rtype: (str, str, int)\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_hyp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  const char* __pyx_v_hyp;
  const char* __pyx_v_uttid;
  int __pyx_v_score;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_hyp");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":547
 *         cdef int score
 * 
 *         hyp = ps_get_hyp(self.ps, &score, &uttid)             # <<<<<<<<<<<<<<
 * 
 *         # No result
 */
  __pyx_v_hyp = ps_get_hyp(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, (&__pyx_v_score), (&__pyx_v_uttid));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":550
 * 
 *         # No result
 *         if hyp == NULL:             # <<<<<<<<<<<<<<
 *              return None, uttid, 0
 * 
 */
  __pyx_t_1 = (__pyx_v_hyp == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":551
 *         # No result
 *         if hyp == NULL:
 *              return None, uttid, 0             # <<<<<<<<<<<<<<
 * 
 *         return hyp, uttid, score
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_uttid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":553
 *              return None, uttid, 0
 * 
 *         return hyp, uttid, score             # <<<<<<<<<<<<<<
 * 
 *     def get_prob(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyBytes_FromString(__pyx_v_hyp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_2 = PyBytes_FromString(__pyx_v_uttid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_4 = PyInt_FromLong(__pyx_v_score); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pocketsphinx.Decoder.get_hyp");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":555
 *         return hyp, uttid, score
 * 
 *     def get_prob(self):             # <<<<<<<<<<<<<<
 *         """
 * 	Get a posterior probability.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_prob(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_get_prob[] = "\n\tGet a posterior probability.\n\t\n\tReturns the posterior in linear scale.\n\t\n\t@return: posterior probability of the result\n\t@rtype: float\n\t";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_prob(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  logmath_t *__pyx_v_lmath;
  const char* __pyx_v_uttid;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_prob");

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":566
 *         cdef logmath_t *lmath
 *         cdef const_char_ptr uttid
 *         lmath = ps_get_logmath(self.ps)             # <<<<<<<<<<<<<<
 *         return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))
 * 
 */
  __pyx_v_lmath = ps_get_logmath(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":567
 *         cdef const_char_ptr uttid
 *         lmath = ps_get_logmath(self.ps)
 *         return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))             # <<<<<<<<<<<<<<
 * 
 *     def get_lattice(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(logmath_exp(__pyx_v_lmath, ps_get_prob(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, (&__pyx_v_uttid)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Decoder.get_prob");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":569
 *         return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))
 * 
 *     def get_lattice(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the word lattice.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_get_lattice[] = "\n        Get the word lattice.\n\n        This function returns all hypotheses which have been\n        considered so far, in the form of a word lattice.\n\n        @return: Word lattice\n        @rtype: Lattice\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  ps_lattice_t *__pyx_v_dag;
  struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_lat;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_lattice");
  __pyx_v_lat = ((struct __pyx_obj_12pocketsphinx_Lattice *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":582
 *         cdef Lattice lat
 * 
 *         dag = ps_get_lattice(self.ps)             # <<<<<<<<<<<<<<
 *         if dag == NULL:
 *             raise RuntimeError, "Failed to create word lattice"
 */
  __pyx_v_dag = ps_get_lattice(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":583
 * 
 *         dag = ps_get_lattice(self.ps)
 *         if dag == NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError, "Failed to create word lattice"
 *         lat = Lattice()
 */
  __pyx_t_1 = (__pyx_v_dag == NULL);
  if (__pyx_t_1) {

    /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":584
 *         dag = ps_get_lattice(self.ps)
 *         if dag == NULL:
 *             raise RuntimeError, "Failed to create word lattice"             # <<<<<<<<<<<<<<
 *         lat = Lattice()
 *         lat.set_dag(dag)
 */
    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_11), 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":585
 *         if dag == NULL:
 *             raise RuntimeError, "Failed to create word lattice"
 *         lat = Lattice()             # <<<<<<<<<<<<<<
 *         lat.set_dag(dag)
 *         return lat
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_12pocketsphinx_Lattice)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_lat));
  __pyx_v_lat = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":586
 *             raise RuntimeError, "Failed to create word lattice"
 *         lat = Lattice()
 *         lat.set_dag(dag)             # <<<<<<<<<<<<<<
 *         return lat
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_12pocketsphinx_Lattice *)__pyx_v_lat->__pyx_vtab)->set_dag(__pyx_v_lat, __pyx_v_dag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":587
 *         lat = Lattice()
 *         lat.set_dag(dag)
 *         return lat             # <<<<<<<<<<<<<<
 * 
 *     def get_lmset(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_lat));
  __pyx_r = ((PyObject *)__pyx_v_lat);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pocketsphinx.Decoder.get_lattice");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_lat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":589
 *         return lat
 * 
 *     def get_lmset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the language model set.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lmset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_get_lmset[] = "\n        Get the language model set.\n\n        This function returns the language model set, which allows you\n        to obtain language model scores or switch language models.\n\n        @return: Language model set\n        @rtype: sphinxbase.NGramModel\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lmset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  ngram_model_t *__pyx_v_clm;
  logmath_t *__pyx_v_lmath;
  cmd_ln_t *__pyx_v_config;
  struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lm;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_lmset");
  __pyx_v_lm = ((struct __pyx_obj_10sphinxbase_NGramModel *)Py_None); __Pyx_INCREF(Py_None);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":604
 *         cdef NGramModel lm
 * 
 *         clm = ps_get_lmset(self.ps)             # <<<<<<<<<<<<<<
 *         lm = NGramModel()
 *         lm.set_lm(clm)
 */
  __pyx_v_clm = ps_get_lmset(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":605
 * 
 *         clm = ps_get_lmset(self.ps)
 *         lm = NGramModel()             # <<<<<<<<<<<<<<
 *         lm.set_lm(clm)
 *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10sphinxbase_NGramModel)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_lm));
  __pyx_v_lm = ((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":606
 *         clm = ps_get_lmset(self.ps)
 *         lm = NGramModel()
 *         lm.set_lm(clm)             # <<<<<<<<<<<<<<
 *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
 *         lm.set_lmath(lmath)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10sphinxbase_NGramModel *)__pyx_v_lm->__pyx_vtab)->set_lm(__pyx_v_lm, __pyx_v_clm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":607
 *         lm = NGramModel()
 *         lm.set_lm(clm)
 *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))             # <<<<<<<<<<<<<<
 *         lm.set_lmath(lmath)
 *         config = ps_get_config(self.ps)
 */
  __pyx_v_lmath = logmath_retain(ps_get_logmath(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps));

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":608
 *         lm.set_lm(clm)
 *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
 *         lm.set_lmath(lmath)             # <<<<<<<<<<<<<<
 *         config = ps_get_config(self.ps)
 *         # This is not necessarily true but it will have to do
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10sphinxbase_NGramModel *)__pyx_v_lm->__pyx_vtab)->set_lmath(__pyx_v_lm, __pyx_v_lmath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":609
 *         lmath = sb.logmath_retain(ps_get_logmath(self.ps))
 *         lm.set_lmath(lmath)
 *         config = ps_get_config(self.ps)             # <<<<<<<<<<<<<<
 *         # This is not necessarily true but it will have to do
 *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")
 */
  __pyx_v_config = ps_get_config(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":611
 *         config = ps_get_config(self.ps)
 *         # This is not necessarily true but it will have to do
 *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")             # <<<<<<<<<<<<<<
 *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")
 *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")
 */
  __pyx_v_lm->lw = cmd_ln_float32_r(__pyx_v_config, __pyx_k_12);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":612
 *         # This is not necessarily true but it will have to do
 *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")
 *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")             # <<<<<<<<<<<<<<
 *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")
 *         return lm
 */
  __pyx_v_lm->wip = cmd_ln_float32_r(__pyx_v_config, __pyx_k_13);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":613
 *         lm.lw = sb.cmd_ln_float32_r(config, "-lw")
 *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")
 *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")             # <<<<<<<<<<<<<<
 *         return lm
 * 
 */
  __pyx_v_lm->uw = cmd_ln_float32_r(__pyx_v_config, __pyx_k_14);

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":614
 *         lm.wip = sb.cmd_ln_float32_r(config, "-wip")
 *         lm.uw = sb.cmd_ln_float32_r(config, "-uw")
 *         return lm             # <<<<<<<<<<<<<<
 * 
 *     def add_word(self, word, phones, update=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_lm));
  __pyx_r = ((PyObject *)__pyx_v_lm);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.Decoder.get_lmset");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_lm);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":616
 *         return lm
 * 
 *     def add_word(self, word, phones, update=True):             # <<<<<<<<<<<<<<
 *         """
 *         Add a word to the dictionary and current language model.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_add_word(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_add_word[] = "\n        Add a word to the dictionary and current language model.\n\n        @param word: Name of the word to add.\n        @type word: str\n        @param phones: Pronunciation of the word, a space-separated list of phones.\n        @type phones: str\n        @param update: Update the decoder to recognize this new word.\n        If adding a number of words at once you may wish to pass\n        C{False} here.\n        @type update: bool\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_add_word(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word = 0;
  PyObject *__pyx_v_phones = 0;
  PyObject *__pyx_v_update = 0;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  char *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__phones,&__pyx_n_s__update,0};
  __Pyx_RefNannySetupContext("add_word");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_15;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__phones);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("add_word", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__update);
        if (value) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_word") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_word = values[0];
    __pyx_v_phones = values[1];
    __pyx_v_update = values[2];
  } else {
    __pyx_v_update = __pyx_k_15;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_update = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2:
      __pyx_v_phones = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_word = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_word", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.add_word");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":629
 *         @type update: bool
 *         """
 *         return ps_add_word(self.ps, word, phones, update)             # <<<<<<<<<<<<<<
 * 
 *     def load_dict(self, dictfile, fdictfile=None, format=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_AsString(__pyx_v_word); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyBytes_AsString(__pyx_v_phones); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_update); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyInt_FromLong(ps_add_word(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_t_1, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pocketsphinx.Decoder.add_word");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":631
 *         return ps_add_word(self.ps, word, phones, update)
 * 
 *     def load_dict(self, dictfile, fdictfile=None, format=None):             # <<<<<<<<<<<<<<
 *         """
 *         Load a new pronunciation dictionary.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_load_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_load_dict[] = "\n        Load a new pronunciation dictionary.\n\n        @param dictfile: Dictionary filename.\n        @type dictfile: str\n        @param fdictfile: Filler dictionary filename.\n        @type fdictfile: str\n        @param format: Dictionary format, currently unused.\n        @type format: str\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_load_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dictfile = 0;
  PyObject *__pyx_v_fdictfile = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  char *__pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dictfile,&__pyx_n_s__fdictfile,&__pyx_n_s__format,0};
  __Pyx_RefNannySetupContext("load_dict");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dictfile);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fdictfile);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
        if (value) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "load_dict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_dictfile = values[0];
    __pyx_v_fdictfile = values[1];
    __pyx_v_format = values[2];
  } else {
    __pyx_v_fdictfile = ((PyObject *)Py_None);
    __pyx_v_format = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_fdictfile = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_dictfile = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_dict", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.load_dict");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":642
 *         @type format: str
 *         """
 *         return ps_load_dict(self.ps, dictfile, fdictfile, format)             # <<<<<<<<<<<<<<
 * 
 *     def save_dict(self, dictfile, format=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_AsString(__pyx_v_dictfile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyBytes_AsString(__pyx_v_fdictfile); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyBytes_AsString(__pyx_v_format); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyInt_FromLong(ps_load_dict(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_t_1, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pocketsphinx.Decoder.load_dict");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":644
 *         return ps_load_dict(self.ps, dictfile, fdictfile, format)
 * 
 *     def save_dict(self, dictfile, format=None):             # <<<<<<<<<<<<<<
 *         """
 *         Save current pronunciation dictionary to a file.
 */

static PyObject *__pyx_pf_12pocketsphinx_7Decoder_save_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_12pocketsphinx_7Decoder_save_dict[] = "\n        Save current pronunciation dictionary to a file.\n\n        @param dictfile: Dictionary filename.\n        @type dictfile: str\n        @param format: Dictionary format, currently unused.\n        @type format: str\n        ";
static PyObject *__pyx_pf_12pocketsphinx_7Decoder_save_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dictfile = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dictfile,&__pyx_n_s__format,0};
  __Pyx_RefNannySetupContext("save_dict");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dictfile);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
        if (value) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "save_dict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_dictfile = values[0];
    __pyx_v_format = values[1];
  } else {
    __pyx_v_format = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_dictfile = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_dict", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pocketsphinx.Decoder.save_dict");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":653
 *         @type format: str
 *         """
 *         return ps_save_dict(self.ps, dictfile, format)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_AsString(__pyx_v_dictfile); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyBytes_AsString(__pyx_v_format); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromLong(ps_save_dict(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pocketsphinx.Decoder.save_dict");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":141
 *     cdef ngram_model_t *lm
 *     cdef logmath_t *lmath
 *     cdef readonly float lw, wip, uw             # <<<<<<<<<<<<<<
 * 
 *     cdef set_lm(NGramModel self, ngram_model_t *lm)
 */

static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2lw___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2lw___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_v_self)->lw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sphinxbase.NGramModel.lw.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10sphinxbase_10NGramModel_3wip___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_10sphinxbase_10NGramModel_3wip___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_v_self)->wip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sphinxbase.NGramModel.wip.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2uw___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2uw___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_v_self)->uw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sphinxbase.NGramModel.uw.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":154
 *     cdef int first_item
 *     cdef int m
 *     cdef readonly float log_prob, log_bowt             # <<<<<<<<<<<<<<
 *     cdef readonly object words
 * 
 */

static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_prob___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_prob___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->log_prob); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sphinxbase.NGramIter.log_prob.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_bowt___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_bowt___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->log_bowt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sphinxbase.NGramIter.log_bowt.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":155
 *     cdef int m
 *     cdef readonly float log_prob, log_bowt
 *     cdef readonly object words             # <<<<<<<<<<<<<<
 * 
 *     cdef set_iter(NGramIter self, ngram_iter_t *itor)
 */

static PyObject *__pyx_pf_10sphinxbase_9NGramIter_5words___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_10sphinxbase_9NGramIter_5words___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->words);
  __pyx_r = ((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->words;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":149
 *     cdef set_dag(Lattice self, ps_lattice_t *dag)
 *     cdef set_boxed(Lattice self, box)
 *     cdef readonly n_frames             # <<<<<<<<<<<<<<
 * 
 * cdef class LatLink:
 */

static PyObject *__pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->n_frames);
  __pyx_r = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->n_frames;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":154
 *     cdef ps_latlink_t *link
 *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
 *     cdef readonly char *word, *baseword             # <<<<<<<<<<<<<<
 *     cdef readonly int sf, ef
 *     cdef readonly double prob
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4word___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4word___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatLink.word.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->baseword); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatLink.baseword.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":155
 *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
 *     cdef readonly char *word, *baseword
 *     cdef readonly int sf, ef             # <<<<<<<<<<<<<<
 *     cdef readonly double prob
 *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2sf___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2sf___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->sf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatLink.sf.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2ef___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2ef___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->ef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatLink.ef.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":156
 *     cdef readonly char *word, *baseword
 *     cdef readonly int sf, ef
 *     cdef readonly double prob             # <<<<<<<<<<<<<<
 *     cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
 * 
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4prob___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4prob___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->prob); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatLink.prob.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":167
 *     cdef ps_latnode_t *node
 *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
 *     cdef readonly char *word, *baseword             # <<<<<<<<<<<<<<
 *     cdef readonly int sf, fef, lef
 *     cdef readonly double prob
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4word___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4word___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->word); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.word.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->baseword); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.baseword.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":168
 *     cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
 *     cdef readonly char *word, *baseword
 *     cdef readonly int sf, fef, lef             # <<<<<<<<<<<<<<
 *     cdef readonly double prob
 *     cdef readonly LatLink best_exit
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_2sf___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_2sf___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->sf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.sf.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3fef___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3fef___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->fef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.fef.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3lef___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3lef___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->lef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.lef.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":169
 *     cdef readonly char *word, *baseword
 *     cdef readonly int sf, fef, lef
 *     cdef readonly double prob             # <<<<<<<<<<<<<<
 *     cdef readonly LatLink best_exit
 *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4prob___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4prob___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->prob); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pocketsphinx.LatNode.prob.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":170
 *     cdef readonly int sf, fef, lef
 *     cdef readonly double prob
 *     cdef readonly LatLink best_exit             # <<<<<<<<<<<<<<
 *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
 * 
 */

static PyObject *__pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->best_exit));
  __pyx_r = ((PyObject *)((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->best_exit);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_12pocketsphinx_Decoder __pyx_vtable_12pocketsphinx_Decoder;

static PyObject *__pyx_tp_new_12pocketsphinx_Decoder(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_12pocketsphinx_Decoder *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_12pocketsphinx_Decoder *)o);
  p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_Decoder;
  return o;
}

static void __pyx_tp_dealloc_12pocketsphinx_Decoder(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_12pocketsphinx_7Decoder___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_12pocketsphinx_Decoder[] = {
  {__Pyx_NAMESTR("decode_raw"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_decode_raw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_decode_raw)},
  {__Pyx_NAMESTR("decode_senscr"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_decode_senscr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_decode_senscr)},
  {__Pyx_NAMESTR("start_utt"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_start_utt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_start_utt)},
  {__Pyx_NAMESTR("process_raw"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_process_raw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_process_raw)},
  {__Pyx_NAMESTR("ps_end_utt"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_ps_end_utt)},
  {__Pyx_NAMESTR("get_hyp"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_hyp, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_hyp)},
  {__Pyx_NAMESTR("get_prob"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_prob, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_prob)},
  {__Pyx_NAMESTR("get_lattice"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_lattice, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_lattice)},
  {__Pyx_NAMESTR("get_lmset"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_lmset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_lmset)},
  {__Pyx_NAMESTR("add_word"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_add_word, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_add_word)},
  {__Pyx_NAMESTR("load_dict"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_load_dict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_load_dict)},
  {__Pyx_NAMESTR("save_dict"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_save_dict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_save_dict)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Decoder = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Decoder = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Decoder = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Decoder = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_12pocketsphinx_Decoder = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pocketsphinx.Decoder"), /*tp_name*/
  sizeof(struct __pyx_obj_12pocketsphinx_Decoder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12pocketsphinx_Decoder, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Decoder, /*tp_as_number*/
  &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Decoder, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  __Pyx_DOCSTR("\n    PocketSphinx speech decoder.\n\n    To initialize the PocketSphinx decoder, pass a list of keyword\n    arguments to the constructor::\n\n     d = pocketsphinx.Decoder(hmm='/path/to/acoustic/model',\n                              lm='/path/to/language/model',\n                              dict='/path/to/dictionary',\n                              beam='1e-80')\n\n    If no arguments are passed, the default acoustic and language\n    models will be loaded, which may be acceptable for general English\n    speech.  Any arguments supported by the PocketSphinx decoder are\n    allowed here.  Only the most frequent ones are described below.\n\n    @param boxed: Boxed pointer from GStreamer containing a decoder\n    @type boxed: PyGBoxed\n    @param hmm: Path to acoustic model directory\n    @type hmm: str\n    @param dict: Path to dictionary file\n    @type dict: str\n    @param lm: Path to language model file\n    @type lm: str\n    @param jsgf: Path to JSGF grammar file\n    @type jsgf str\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_12pocketsphinx_Decoder, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_12pocketsphinx_7Decoder___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12pocketsphinx_Decoder, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_12pocketsphinx_Lattice __pyx_vtable_12pocketsphinx_Lattice;

static PyObject *__pyx_tp_new_12pocketsphinx_Lattice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_12pocketsphinx_Lattice *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_12pocketsphinx_Lattice *)o);
  p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_Lattice;
  p->n_frames = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_12pocketsphinx_Lattice(PyObject *o) {
  struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_12pocketsphinx_7Lattice___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->n_frames);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_12pocketsphinx_Lattice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
  if (p->n_frames) {
    e = (*v)(p->n_frames, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12pocketsphinx_Lattice(PyObject *o) {
  struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->n_frames);
  p->n_frames = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_12pocketsphinx_7Lattice_n_frames(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(o);
}

static PyMethodDef __pyx_methods_12pocketsphinx_Lattice[] = {
  {__Pyx_NAMESTR("bestpath"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_bestpath, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_bestpath)},
  {__Pyx_NAMESTR("posterior"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_posterior, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_posterior)},
  {__Pyx_NAMESTR("nodes"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_nodes, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_nodes)},
  {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_write, METH_O, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_write)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_12pocketsphinx_Lattice[] = {
  {(char *)"n_frames", __pyx_getprop_12pocketsphinx_7Lattice_n_frames, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Lattice = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Lattice = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Lattice = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Lattice = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_12pocketsphinx_Lattice = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pocketsphinx.Lattice"), /*tp_name*/
  sizeof(struct __pyx_obj_12pocketsphinx_Lattice), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12pocketsphinx_Lattice, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Lattice, /*tp_as_number*/
  &__pyx_tp_as_sequence_Lattice, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Lattice, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Lattice, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Word lattice.\n\n    The word lattice is a compact representation of the set of\n    hypotheses considered by the decoder when recognizing an\n    utterance.\n\n    A lattice object can be constructed either from a lattice file\n    on disk or from a 'boxed' object passed in from GStreamer (or,\n    in theory, anything else that uses GLib).  In the first case,\n    the C{ps} argument is required.\n\n    @param ps: PocketSphinx decoder.\n    @type ps: Decoder\n    @param latfile: Filename of lattice file to read.\n    @type latfile: str\n    @param boxed: Boxed pointer from GStreamer containing a lattice\n    @type boxed: PyGBoxed\n\n    @ivar n_frames: Number of frames of audio covered by this lattice\n    @type n_frames: int\n    @ivar start: Start node\n    @type start: LatNode\n    @ivar end: End node\n    @type end: LatNode\n    "), /*tp_doc*/
  __pyx_tp_traverse_12pocketsphinx_Lattice, /*tp_traverse*/
  __pyx_tp_clear_12pocketsphinx_Lattice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_12pocketsphinx_Lattice, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_12pocketsphinx_Lattice, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_12pocketsphinx_7Lattice___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12pocketsphinx_Lattice, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_12pocketsphinx_LatLink __pyx_vtable_12pocketsphinx_LatLink;

static PyObject *__pyx_tp_new_12pocketsphinx_LatLink(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_12pocketsphinx_LatLink *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_12pocketsphinx_LatLink *)o);
  p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_LatLink;
  if (__pyx_pf_12pocketsphinx_7LatLink___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12pocketsphinx_LatLink(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_word(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatLink_4word___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_baseword(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_sf(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatLink_2sf___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_ef(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatLink_2ef___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_prob(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatLink_4prob___get__(o);
}

static PyMethodDef __pyx_methods_12pocketsphinx_LatLink[] = {
  {__Pyx_NAMESTR("nodes"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatLink_nodes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatLink_nodes)},
  {__Pyx_NAMESTR("pred"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatLink_pred, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatLink_pred)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_12pocketsphinx_LatLink[] = {
  {(char *)"word", __pyx_getprop_12pocketsphinx_7LatLink_word, 0, 0, 0},
  {(char *)"baseword", __pyx_getprop_12pocketsphinx_7LatLink_baseword, 0, 0, 0},
  {(char *)"sf", __pyx_getprop_12pocketsphinx_7LatLink_sf, 0, 0, 0},
  {(char *)"ef", __pyx_getprop_12pocketsphinx_7LatLink_ef, 0, 0, 0},
  {(char *)"prob", __pyx_getprop_12pocketsphinx_7LatLink_prob, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_LatLink = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_LatLink = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LatLink = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_LatLink = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_12pocketsphinx_LatLink = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pocketsphinx.LatLink"), /*tp_name*/
  sizeof(struct __pyx_obj_12pocketsphinx_LatLink), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12pocketsphinx_LatLink, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_LatLink, /*tp_as_number*/
  &__pyx_tp_as_sequence_LatLink, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LatLink, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_LatLink, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  __Pyx_DOCSTR("\n    Link (edge) in a word lattice, connecting two nodes.\n\n    @ivar word: Word (with pronunciation variant) for this link.\n    @type word: str\n    @ivar baseword: Base word (no pronunciation variant) for this link.\n    @type baseword: str\n    @ivar sf: Start frame for this link.\n    @type sf: int\n    @ivar fef: Ending frame for this link.\n    @type fef: int\n    @ivar prob: Posterior probability for this link.\n    @type prob: float\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_12pocketsphinx_LatLink, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_12pocketsphinx_LatLink, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12pocketsphinx_LatLink, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_12pocketsphinx_LatLinkIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12pocketsphinx_LatLinkIterator(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_12pocketsphinx_LatLinkIterator[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_12pocketsphinx_15LatLinkIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_15LatLinkIterator___next__)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_LatLinkIterator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_LatLinkIterator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LatLinkIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_LatLinkIterator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_12pocketsphinx_LatLinkIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pocketsphinx.LatLinkIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_12pocketsphinx_LatLinkIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12pocketsphinx_LatLinkIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_LatLinkIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence_LatLinkIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LatLinkIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_LatLinkIterator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  __Pyx_DOCSTR("\n    Iterator over word lattice links.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_12pocketsphinx_15LatLinkIterator___iter__, /*tp_iter*/
  __pyx_pf_12pocketsphinx_15LatLinkIterator___next__, /*tp_iternext*/
  __pyx_methods_12pocketsphinx_LatLinkIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12pocketsphinx_LatLinkIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_12pocketsphinx_LatNode __pyx_vtable_12pocketsphinx_LatNode;

static PyObject *__pyx_tp_new_12pocketsphinx_LatNode(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_12pocketsphinx_LatNode *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_12pocketsphinx_LatNode *)o);
  p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_LatNode;
  p->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_12pocketsphinx_7LatNode___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_12pocketsphinx_LatNode(PyObject *o) {
  struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
  Py_XDECREF(((PyObject *)p->best_exit));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_12pocketsphinx_LatNode(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
  if (p->best_exit) {
    e = (*v)(((PyObject*)p->best_exit), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_12pocketsphinx_LatNode(PyObject *o) {
  struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->best_exit);
  p->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_word(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_4word___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_baseword(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_sf(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_2sf___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_fef(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_3fef___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_lef(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_3lef___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_prob(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_4prob___get__(o);
}

static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_best_exit(PyObject *o, void *x) {
  return __pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(o);
}

static PyMethodDef __pyx_methods_12pocketsphinx_LatNode[] = {
  {__Pyx_NAMESTR("exits"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatNode_exits, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatNode_exits)},
  {__Pyx_NAMESTR("entries"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatNode_entries, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatNode_entries)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_12pocketsphinx_LatNode[] = {
  {(char *)"word", __pyx_getprop_12pocketsphinx_7LatNode_word, 0, 0, 0},
  {(char *)"baseword", __pyx_getprop_12pocketsphinx_7LatNode_baseword, 0, 0, 0},
  {(char *)"sf", __pyx_getprop_12pocketsphinx_7LatNode_sf, 0, 0, 0},
  {(char *)"fef", __pyx_getprop_12pocketsphinx_7LatNode_fef, 0, 0, 0},
  {(char *)"lef", __pyx_getprop_12pocketsphinx_7LatNode_lef, 0, 0, 0},
  {(char *)"prob", __pyx_getprop_12pocketsphinx_7LatNode_prob, 0, 0, 0},
  {(char *)"best_exit", __pyx_getprop_12pocketsphinx_7LatNode_best_exit, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_LatNode = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_LatNode = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LatNode = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_LatNode = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_12pocketsphinx_LatNode = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pocketsphinx.LatNode"), /*tp_name*/
  sizeof(struct __pyx_obj_12pocketsphinx_LatNode), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12pocketsphinx_LatNode, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_LatNode, /*tp_as_number*/
  &__pyx_tp_as_sequence_LatNode, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LatNode, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_LatNode, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Node in a word lattice.\n\n    @ivar word: Word this node corresponds to (with pronunciation variant).\n    @type word: str\n    @ivar baseword: Base word (no pronunciation variant) this node corresponds to.\n    @type baseword: str\n    @ivar sf: Start frame for this node.\n    @type sf: int\n    @ivar fef: First ending frame for this node.\n    @type fef: int\n    @ivar lef: Last ending frame for this node.\n    @type lef: int\n    @ivar best_exit: Best scoring exit link from this node\n    @type best_exit: LatLink\n    @ivar prob: Posterior probability for this node.\n    @type prob: float\n    "), /*tp_doc*/
  __pyx_tp_traverse_12pocketsphinx_LatNode, /*tp_traverse*/
  __pyx_tp_clear_12pocketsphinx_LatNode, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_12pocketsphinx_LatNode, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_12pocketsphinx_LatNode, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12pocketsphinx_LatNode, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_12pocketsphinx_LatNodeIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_12pocketsphinx_LatNodeIterator(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_12pocketsphinx_LatNodeIterator[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_12pocketsphinx_15LatNodeIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_15LatNodeIterator___next__)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_LatNodeIterator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_LatNodeIterator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LatNodeIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_LatNodeIterator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_12pocketsphinx_LatNodeIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pocketsphinx.LatNodeIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_12pocketsphinx_LatNodeIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_12pocketsphinx_LatNodeIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_LatNodeIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence_LatNodeIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LatNodeIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_LatNodeIterator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  __Pyx_DOCSTR("\n    Iterator over word lattice nodes.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_12pocketsphinx_15LatNodeIterator___iter__, /*tp_iter*/
  __pyx_pf_12pocketsphinx_15LatNodeIterator___next__, /*tp_iternext*/
  __pyx_methods_12pocketsphinx_LatNodeIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_12pocketsphinx_15LatNodeIterator___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_12pocketsphinx_LatNodeIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("pocketsphinx"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0},
  {&__pyx_kp_u_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 0, 0},
  {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0},
  {&__pyx_kp_u_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 1, 0, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_u_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 1, 0, 0},
  {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0},
  {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0},
  {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0},
  {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0},
  {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0},
  {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0},
  {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0},
  {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
  {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
  {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0},
  {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0},
  {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0},
  {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0},
  {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0},
  {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0},
  {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_n_s__Decoder, __pyx_k__Decoder, sizeof(__pyx_k__Decoder), 0, 0, 1, 1},
  {&__pyx_n_s__LatLink, __pyx_k__LatLink, sizeof(__pyx_k__LatLink), 0, 0, 1, 1},
  {&__pyx_n_s__LatLinkIterator, __pyx_k__LatLinkIterator, sizeof(__pyx_k__LatLinkIterator), 0, 0, 1, 1},
  {&__pyx_n_s__LatNode, __pyx_k__LatNode, sizeof(__pyx_k__LatNode), 0, 0, 1, 1},
  {&__pyx_n_s__LatNodeIterator, __pyx_k__LatNodeIterator, sizeof(__pyx_k__LatNodeIterator), 0, 0, 1, 1},
  {&__pyx_n_s__Lattice, __pyx_k__Lattice, sizeof(__pyx_k__Lattice), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____next__, __pyx_k____next__, sizeof(__pyx_k____next__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__add_word, __pyx_k__add_word, sizeof(__pyx_k__add_word), 0, 0, 1, 1},
  {&__pyx_n_s__argc, __pyx_k__argc, sizeof(__pyx_k__argc), 0, 0, 1, 1},
  {&__pyx_n_s__argv, __pyx_k__argv, sizeof(__pyx_k__argv), 0, 0, 1, 1},
  {&__pyx_n_s__ascale, __pyx_k__ascale, sizeof(__pyx_k__ascale), 0, 0, 1, 1},
  {&__pyx_n_s__baseword, __pyx_k__baseword, sizeof(__pyx_k__baseword), 0, 0, 1, 1},
  {&__pyx_n_s__best_exit, __pyx_k__best_exit, sizeof(__pyx_k__best_exit), 0, 0, 1, 1},
  {&__pyx_n_s__bestpath, __pyx_k__bestpath, sizeof(__pyx_k__bestpath), 0, 0, 1, 1},
  {&__pyx_n_s__boxed, __pyx_k__boxed, sizeof(__pyx_k__boxed), 0, 0, 1, 1},
  {&__pyx_n_s__dag, __pyx_k__dag, sizeof(__pyx_k__dag), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__decode_raw, __pyx_k__decode_raw, sizeof(__pyx_k__decode_raw), 0, 0, 1, 1},
  {&__pyx_n_s__decode_senscr, __pyx_k__decode_senscr, sizeof(__pyx_k__decode_senscr), 0, 0, 1, 1},
  {&__pyx_n_s__dictfile, __pyx_k__dictfile, sizeof(__pyx_k__dictfile), 0, 0, 1, 1},
  {&__pyx_n_s__ef, __pyx_k__ef, sizeof(__pyx_k__ef), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__entries, __pyx_k__entries, sizeof(__pyx_k__entries), 0, 0, 1, 1},
  {&__pyx_n_s__exits, __pyx_k__exits, sizeof(__pyx_k__exits), 0, 0, 1, 1},
  {&__pyx_n_s__fdictfile, __pyx_k__fdictfile, sizeof(__pyx_k__fdictfile), 0, 0, 1, 1},
  {&__pyx_n_s__fef, __pyx_k__fef, sizeof(__pyx_k__fef), 0, 0, 1, 1},
  {&__pyx_n_s__fh, __pyx_k__fh, sizeof(__pyx_k__fh), 0, 0, 1, 1},
  {&__pyx_n_s__first_link, __pyx_k__first_link, sizeof(__pyx_k__first_link), 0, 0, 1, 1},
  {&__pyx_n_s__first_node, __pyx_k__first_node, sizeof(__pyx_k__first_node), 0, 0, 1, 1},
  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
  {&__pyx_n_s__full_utt, __pyx_k__full_utt, sizeof(__pyx_k__full_utt), 0, 0, 1, 1},
  {&__pyx_n_s__get_hyp, __pyx_k__get_hyp, sizeof(__pyx_k__get_hyp), 0, 0, 1, 1},
  {&__pyx_n_s__get_lattice, __pyx_k__get_lattice, sizeof(__pyx_k__get_lattice), 0, 0, 1, 1},
  {&__pyx_n_s__get_lmset, __pyx_k__get_lmset, sizeof(__pyx_k__get_lmset), 0, 0, 1, 1},
  {&__pyx_n_s__get_prob, __pyx_k__get_prob, sizeof(__pyx_k__get_prob), 0, 0, 1, 1},
  {&__pyx_n_s__itor, __pyx_k__itor, sizeof(__pyx_k__itor), 0, 0, 1, 1},
  {&__pyx_n_s__latfile, __pyx_k__latfile, sizeof(__pyx_k__latfile), 0, 0, 1, 1},
  {&__pyx_n_s__lef, __pyx_k__lef, sizeof(__pyx_k__lef), 0, 0, 1, 1},
  {&__pyx_n_s__link, __pyx_k__link, sizeof(__pyx_k__link), 0, 0, 1, 1},
  {&__pyx_n_s__lm, __pyx_k__lm, sizeof(__pyx_k__lm), 0, 0, 1, 1},
  {&__pyx_n_s__lmset, __pyx_k__lmset, sizeof(__pyx_k__lmset), 0, 0, 1, 1},
  {&__pyx_n_s__load_dict, __pyx_k__load_dict, sizeof(__pyx_k__load_dict), 0, 0, 1, 1},
  {&__pyx_n_s__log_bowt, __pyx_k__log_bowt, sizeof(__pyx_k__log_bowt), 0, 0, 1, 1},
  {&__pyx_n_s__log_prob, __pyx_k__log_prob, sizeof(__pyx_k__log_prob), 0, 0, 1, 1},
  {&__pyx_n_s__lw, __pyx_k__lw, sizeof(__pyx_k__lw), 0, 0, 1, 1},
  {&__pyx_n_s__lwf, __pyx_k__lwf, sizeof(__pyx_k__lwf), 0, 0, 1, 1},
  {&__pyx_n_s__maxsamps, __pyx_k__maxsamps, sizeof(__pyx_k__maxsamps), 0, 0, 1, 1},
  {&__pyx_n_s__n_frames, __pyx_k__n_frames, sizeof(__pyx_k__n_frames), 0, 0, 1, 1},
  {&__pyx_n_s__no_search, __pyx_k__no_search, sizeof(__pyx_k__no_search), 0, 0, 1, 1},
  {&__pyx_n_s__node, __pyx_k__node, sizeof(__pyx_k__node), 0, 0, 1, 1},
  {&__pyx_n_s__nodes, __pyx_k__nodes, sizeof(__pyx_k__nodes), 0, 0, 1, 1},
  {&__pyx_n_s__phones, __pyx_k__phones, sizeof(__pyx_k__phones), 0, 0, 1, 1},
  {&__pyx_n_s__posterior, __pyx_k__posterior, sizeof(__pyx_k__posterior), 0, 0, 1, 1},
  {&__pyx_n_s__pred, __pyx_k__pred, sizeof(__pyx_k__pred), 0, 0, 1, 1},
  {&__pyx_n_s__prob, __pyx_k__prob, sizeof(__pyx_k__prob), 0, 0, 1, 1},
  {&__pyx_n_s__process_raw, __pyx_k__process_raw, sizeof(__pyx_k__process_raw), 0, 0, 1, 1},
  {&__pyx_n_s__ps, __pyx_k__ps, sizeof(__pyx_k__ps), 0, 0, 1, 1},
  {&__pyx_n_s__ps_end_utt, __pyx_k__ps_end_utt, sizeof(__pyx_k__ps_end_utt), 0, 0, 1, 1},
  {&__pyx_n_s__read_dag, __pyx_k__read_dag, sizeof(__pyx_k__read_dag), 0, 0, 1, 1},
  {&__pyx_n_s__save_dict, __pyx_k__save_dict, sizeof(__pyx_k__save_dict), 0, 0, 1, 1},
  {&__pyx_n_s__set_boxed, __pyx_k__set_boxed, sizeof(__pyx_k__set_boxed), 0, 0, 1, 1},
  {&__pyx_n_s__set_dag, __pyx_k__set_dag, sizeof(__pyx_k__set_dag), 0, 0, 1, 1},
  {&__pyx_n_s__set_link, __pyx_k__set_link, sizeof(__pyx_k__set_link), 0, 0, 1, 1},
  {&__pyx_n_s__set_lm, __pyx_k__set_lm, sizeof(__pyx_k__set_lm), 0, 0, 1, 1},
  {&__pyx_n_s__set_lmath, __pyx_k__set_lmath, sizeof(__pyx_k__set_lmath), 0, 0, 1, 1},
  {&__pyx_n_s__set_node, __pyx_k__set_node, sizeof(__pyx_k__set_node), 0, 0, 1, 1},
  {&__pyx_n_s__sf, __pyx_k__sf, sizeof(__pyx_k__sf), 0, 0, 1, 1},
  {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
  {&__pyx_n_s__start_utt, __pyx_k__start_utt, sizeof(__pyx_k__start_utt), 0, 0, 1, 1},
  {&__pyx_n_s__update, __pyx_k__update, sizeof(__pyx_k__update), 0, 0, 1, 1},
  {&__pyx_n_s__uttid, __pyx_k__uttid, sizeof(__pyx_k__uttid), 0, 0, 1, 1},
  {&__pyx_n_s__uw, __pyx_k__uw, sizeof(__pyx_k__uw), 0, 0, 1, 1},
  {&__pyx_n_s__wip, __pyx_k__wip, sizeof(__pyx_k__wip), 0, 0, 1, 1},
  {&__pyx_n_s__word, __pyx_k__word, sizeof(__pyx_k__word), 0, 0, 1, 1},
  {&__pyx_n_s__words, __pyx_k__words, sizeof(__pyx_k__words), 0, 0, 1, 1},
  {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initpocketsphinx(void); /*proto*/
PyMODINIT_FUNC initpocketsphinx(void)
#else
PyMODINIT_FUNC PyInit_pocketsphinx(void); /*proto*/
PyMODINIT_FUNC PyInit_pocketsphinx(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_pocketsphinx(void)", __LINE__, __FILE__);
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("pocketsphinx"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_pocketsphinx) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_12pocketsphinx_Decoder = &__pyx_vtable_12pocketsphinx_Decoder;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_12pocketsphinx_Decoder.set_boxed = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *))__pyx_f_12pocketsphinx_7Decoder_set_boxed;
  #else
  *(void(**)(void))&__pyx_vtable_12pocketsphinx_Decoder.set_boxed = (void(*)(void))__pyx_f_12pocketsphinx_7Decoder_set_boxed;
  #endif
  if (PyType_Ready(&__pyx_type_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_Decoder.tp_dict, __pyx_vtabptr_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_12pocketsphinx_Decoder = &__pyx_type_12pocketsphinx_Decoder;
  __pyx_vtabptr_12pocketsphinx_Lattice = &__pyx_vtable_12pocketsphinx_Lattice;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_12pocketsphinx_Lattice.read_dag = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *))__pyx_f_12pocketsphinx_7Lattice_read_dag;
  __pyx_vtable_12pocketsphinx_Lattice.set_dag = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, ps_lattice_t *))__pyx_f_12pocketsphinx_7Lattice_set_dag;
  __pyx_vtable_12pocketsphinx_Lattice.set_boxed = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, PyObject *))__pyx_f_12pocketsphinx_7Lattice_set_boxed;
  #else
  *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.read_dag = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_read_dag;
  *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.set_dag = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_set_dag;
  *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.set_boxed = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_set_boxed;
  #endif
  if (PyType_Ready(&__pyx_type_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_Lattice.tp_dict, __pyx_vtabptr_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Lattice", (PyObject *)&__pyx_type_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_12pocketsphinx_Lattice = &__pyx_type_12pocketsphinx_Lattice;
  __pyx_vtabptr_12pocketsphinx_LatLink = &__pyx_vtable_12pocketsphinx_LatLink;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_12pocketsphinx_LatLink.set_link = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_LatLink *, ps_lattice_t *, ps_latlink_t *))__pyx_f_12pocketsphinx_7LatLink_set_link;
  #else
  *(void(**)(void))&__pyx_vtable_12pocketsphinx_LatLink.set_link = (void(*)(void))__pyx_f_12pocketsphinx_7LatLink_set_link;
  #endif
  if (PyType_Ready(&__pyx_type_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_LatLink.tp_dict, __pyx_vtabptr_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "LatLink", (PyObject *)&__pyx_type_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_12pocketsphinx_LatLink = &__pyx_type_12pocketsphinx_LatLink;
  if (PyType_Ready(&__pyx_type_12pocketsphinx_LatLinkIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_12pocketsphinx_LatLinkIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__.doc = __pyx_doc_12pocketsphinx_15LatLinkIterator___next__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__;
    }
  }
  if (__Pyx_SetAttrString(__pyx_m, "LatLinkIterator", (PyObject *)&__pyx_type_12pocketsphinx_LatLinkIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_12pocketsphinx_LatLinkIterator = &__pyx_type_12pocketsphinx_LatLinkIterator;
  __pyx_vtabptr_12pocketsphinx_LatNode = &__pyx_vtable_12pocketsphinx_LatNode;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_12pocketsphinx_LatNode.set_node = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_LatNode *, ps_lattice_t *, ps_latnode_t *))__pyx_f_12pocketsphinx_7LatNode_set_node;
  #else
  *(void(**)(void))&__pyx_vtable_12pocketsphinx_LatNode.set_node = (void(*)(void))__pyx_f_12pocketsphinx_7LatNode_set_node;
  #endif
  if (PyType_Ready(&__pyx_type_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_12pocketsphinx_LatNode.tp_dict, __pyx_vtabptr_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "LatNode", (PyObject *)&__pyx_type_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_12pocketsphinx_LatNode = &__pyx_type_12pocketsphinx_LatNode;
  if (PyType_Ready(&__pyx_type_12pocketsphinx_LatNodeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_12pocketsphinx_LatNodeIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__.doc = __pyx_doc_12pocketsphinx_15LatNodeIterator___next__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__;
    }
  }
  if (__Pyx_SetAttrString(__pyx_m, "LatNodeIterator", (PyObject *)&__pyx_type_12pocketsphinx_LatNodeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_12pocketsphinx_LatNodeIterator = &__pyx_type_12pocketsphinx_LatNodeIterator;
  /*--- Type import code ---*/
  __pyx_ptype_10sphinxbase_NGramModel = __Pyx_ImportType("sphinxbase", "NGramModel", sizeof(struct __pyx_obj_10sphinxbase_NGramModel), 1); if (unlikely(!__pyx_ptype_10sphinxbase_NGramModel)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_10sphinxbase_NGramModel->tp_dict, &__pyx_vtabptr_10sphinxbase_NGramModel) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10sphinxbase_LogMath = __Pyx_ImportType("sphinxbase", "LogMath", sizeof(struct __pyx_obj_10sphinxbase_LogMath), 1); if (unlikely(!__pyx_ptype_10sphinxbase_LogMath)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10sphinxbase_NGramIter = __Pyx_ImportType("sphinxbase", "NGramIter", sizeof(struct __pyx_obj_10sphinxbase_NGramIter), 1); if (unlikely(!__pyx_ptype_10sphinxbase_NGramIter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_10sphinxbase_NGramIter->tp_dict, &__pyx_vtabptr_10sphinxbase_NGramIter) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10sphinxbase_HuffCode = __Pyx_ImportType("sphinxbase", "HuffCode", sizeof(struct __pyx_obj_10sphinxbase_HuffCode), 1); if (unlikely(!__pyx_ptype_10sphinxbase_HuffCode)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":499
 *             raise RuntimeError, "Failed to start utterance processing"
 * 
 *     def process_raw(self, data, no_search=False, full_utt=False):             # <<<<<<<<<<<<<<
 *         """
 *         Process (decode) some audio data.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_7 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_8 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":616
 *         return lm
 * 
 *     def add_word(self, word, phones, update=True):             # <<<<<<<<<<<<<<
 *         """
 *         Add a word to the dictionary and current language model.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_15 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":1
 * # Copyright (c) 2008 Carnegie Mellon University. All rights             # <<<<<<<<<<<<<<
 * # reserved.
 * #
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exits); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_16), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__entries); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_17), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatNodeIterator); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____next__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_18), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatLink); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_19), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatLink); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pred); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_20), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__LatLinkIterator); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____next__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_21), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bestpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_22), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__posterior); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_23), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_24), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Lattice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_25), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__decode_raw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_26), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__decode_senscr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_27), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__start_utt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_28), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__process_raw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_29), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ps_end_utt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_30), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_hyp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_31), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_prob); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_32), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_lattice); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_33), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_lmset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_34), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__add_word); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_35), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__load_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_36), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Decoder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__save_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_37), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":170
 *     cdef readonly int sf, fef, lef
 *     cdef readonly double prob
 *     cdef readonly LatLink best_exit             # <<<<<<<<<<<<<<
 *     cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
 * 
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pocketsphinx");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pocketsphinx");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *number, *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
        #endif
            goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}


static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;

    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning), 
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        PyErr_Warn(NULL, warning);
        #else
        PyErr_WarnEx(NULL, warning, 0);
        #endif
    }
    else if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
    PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    *(void **)vtabptr = PyCapsule_GetPointer(ob, 0);
#else
    *(void **)vtabptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!*(void **)vtabptr)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
