1 /* Generated by Cython 0.13 on Sat Oct 16 11:46:23 2010 */
3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
9 #include <stddef.h> /* For offsetof */
11 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14 #if !defined(WIN32) && !defined(MS_WINDOWS)
27 #define DL_IMPORT(t) t
30 #define DL_EXPORT(t) t
34 #define PY_LONG_LONG LONG_LONG
37 #if PY_VERSION_HEX < 0x02040000
38 #define METH_COEXIST 0
39 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
40 #define PyDict_Contains(d,o) PySequence_Contains(d,o)
43 #if PY_VERSION_HEX < 0x02050000
44 typedef int Py_ssize_t;
45 #define PY_SSIZE_T_MAX INT_MAX
46 #define PY_SSIZE_T_MIN INT_MIN
47 #define PY_FORMAT_SIZE_T ""
48 #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
49 #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
50 #define PyNumber_Index(o) PyNumber_Int(o)
51 #define PyIndex_Check(o) PyNumber_Check(o)
52 #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
55 #if PY_VERSION_HEX < 0x02060000
56 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
57 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
58 #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
59 #define PyVarObject_HEAD_INIT(type, size) \
60 PyObject_HEAD_INIT(type) size,
61 #define PyType_Modified(t)
73 Py_ssize_t *suboffsets;
77 #define PyBUF_SIMPLE 0
78 #define PyBUF_WRITABLE 0x0001
79 #define PyBUF_FORMAT 0x0004
80 #define PyBUF_ND 0x0008
81 #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
82 #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
83 #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
84 #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
85 #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
89 #if PY_MAJOR_VERSION < 3
90 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
92 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
95 #if PY_MAJOR_VERSION >= 3
96 #define Py_TPFLAGS_CHECKTYPES 0
97 #define Py_TPFLAGS_HAVE_INDEX 0
100 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
101 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
104 #if PY_MAJOR_VERSION >= 3
105 #define PyBaseString_Type PyUnicode_Type
106 #define PyStringObject PyUnicodeObject
107 #define PyString_Type PyUnicode_Type
108 #define PyString_Check PyUnicode_Check
109 #define PyString_CheckExact PyUnicode_CheckExact
112 #if PY_VERSION_HEX < 0x02060000
113 #define PyBytesObject PyStringObject
114 #define PyBytes_Type PyString_Type
115 #define PyBytes_Check PyString_Check
116 #define PyBytes_CheckExact PyString_CheckExact
117 #define PyBytes_FromString PyString_FromString
118 #define PyBytes_FromStringAndSize PyString_FromStringAndSize
119 #define PyBytes_FromFormat PyString_FromFormat
120 #define PyBytes_DecodeEscape PyString_DecodeEscape
121 #define PyBytes_AsString PyString_AsString
122 #define PyBytes_AsStringAndSize PyString_AsStringAndSize
123 #define PyBytes_Size PyString_Size
124 #define PyBytes_AS_STRING PyString_AS_STRING
125 #define PyBytes_GET_SIZE PyString_GET_SIZE
126 #define PyBytes_Repr PyString_Repr
127 #define PyBytes_Concat PyString_Concat
128 #define PyBytes_ConcatAndDel PyString_ConcatAndDel
129 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
130 #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
133 #ifndef PySet_CheckExact
134 # define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
137 #if PY_MAJOR_VERSION >= 3
138 #define PyInt_Type PyLong_Type
139 #define PyInt_Check(op) PyLong_Check(op)
140 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
141 #define PyInt_FromString PyLong_FromString
142 #define PyInt_FromUnicode PyLong_FromUnicode
143 #define PyInt_FromLong PyLong_FromLong
144 #define PyInt_FromSize_t PyLong_FromSize_t
145 #define PyInt_FromSsize_t PyLong_FromSsize_t
146 #define PyInt_AsLong PyLong_AsLong
147 #define PyInt_AS_LONG PyLong_AS_LONG
148 #define PyInt_AsSsize_t PyLong_AsSsize_t
149 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
150 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
153 #if PY_MAJOR_VERSION >= 3
154 #define PyBoolObject PyLongObject
158 #if PY_MAJOR_VERSION >= 3
159 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
160 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
162 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
163 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
166 #if PY_MAJOR_VERSION >= 3
167 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
170 #if PY_VERSION_HEX < 0x02050000
171 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
172 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
173 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
175 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
176 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
177 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
180 #if PY_VERSION_HEX < 0x02050000
181 #define __Pyx_NAMESTR(n) ((char *)(n))
182 #define __Pyx_DOCSTR(n) ((char *)(n))
184 #define __Pyx_NAMESTR(n) (n)
185 #define __Pyx_DOCSTR(n) (n)
189 #define __PYX_EXTERN_C extern "C"
191 #define __PYX_EXTERN_C extern
194 #if defined(WIN32) || defined(MS_WINDOWS)
195 #define _USE_MATH_DEFINES
198 #define __PYX_HAVE_API__pocketsphinx
199 #include "sphinxbase/logmath.h"
200 #include "sphinxbase/cmd_ln.h"
201 #include "sphinxbase/ckd_alloc.h"
202 #include "sphinxbase/fsg_model.h"
203 #include "sphinxbase/ngram_model.h"
204 #include "sphinxbase/huff_code.h"
206 #include "bogus_pygobject.h"
208 #include "ps_lattice.h"
209 #include "pocketsphinx.h"
211 /* inline attribute */
212 #ifndef CYTHON_INLINE
213 #if defined(__GNUC__)
214 #define CYTHON_INLINE __inline__
215 #elif defined(_MSC_VER)
216 #define CYTHON_INLINE __inline
217 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 #define CYTHON_INLINE inline
220 #define CYTHON_INLINE
224 /* unused attribute */
225 #ifndef CYTHON_UNUSED
226 # if defined(__GNUC__)
227 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
228 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # define CYTHON_UNUSED
232 # elif defined(__ICC) || defined(__INTEL_COMPILER)
233 # define CYTHON_UNUSED __attribute__ ((__unused__))
235 # define CYTHON_UNUSED
239 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*/
242 /* Type Conversion Predeclarations */
244 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
245 #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
247 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
248 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
249 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
251 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
252 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
253 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
255 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
259 /* Test for GCC > 2.95 */
260 #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
261 #define likely(x) __builtin_expect(!!(x), 1)
262 #define unlikely(x) __builtin_expect(!!(x), 0)
263 #else /* __GNUC__ > 2 ... */
264 #define likely(x) (x)
265 #define unlikely(x) (x)
266 #endif /* __GNUC__ > 2 ... */
268 #define likely(x) (x)
269 #define unlikely(x) (x)
270 #endif /* __GNUC__ */
272 static PyObject *__pyx_m;
273 static PyObject *__pyx_b;
274 static PyObject *__pyx_empty_tuple;
275 static PyObject *__pyx_empty_bytes;
276 static int __pyx_lineno;
277 static int __pyx_clineno = 0;
278 static const char * __pyx_cfilenm= __FILE__;
279 static const char *__pyx_filename;
282 static const char *__pyx_f[] = {
288 typedef float __pyx_t_10sphinxbase_float32;
290 typedef int __pyx_t_10sphinxbase_int32;
292 typedef double __pyx_t_10sphinxbase_float64;
294 /* Type declarations */
296 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":159
297 * cdef set_iter(NGramIter self, ngram_iter_t *itor)
299 * cdef class HuffCode: # <<<<<<<<<<<<<<
300 * cdef huff_code_t *hc
304 struct __pyx_obj_10sphinxbase_HuffCode {
310 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":138
312 * # Extension classes
313 * cdef class NGramModel: # <<<<<<<<<<<<<<
314 * cdef ngram_model_t *lm
315 * cdef logmath_t *lmath
318 struct __pyx_obj_10sphinxbase_NGramModel {
320 struct __pyx_vtabstruct_10sphinxbase_NGramModel *__pyx_vtab;
328 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":151
329 * cdef readonly n_frames
331 * cdef class LatLink: # <<<<<<<<<<<<<<
332 * cdef ps_latlink_t *link
333 * cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
336 struct __pyx_obj_12pocketsphinx_LatLink {
338 struct __pyx_vtabstruct_12pocketsphinx_LatLink *__pyx_vtab;
348 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":164
349 * cdef int first_link
351 * cdef class LatNode: # <<<<<<<<<<<<<<
352 * cdef ps_latnode_t *node
353 * cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
356 struct __pyx_obj_12pocketsphinx_LatNode {
358 struct __pyx_vtabstruct_12pocketsphinx_LatNode *__pyx_vtab;
367 struct __pyx_obj_12pocketsphinx_LatLink *best_exit;
370 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":138
372 * # Now, our extension classes
373 * cdef class Decoder: # <<<<<<<<<<<<<<
374 * cdef ps_decoder_t *ps
378 struct __pyx_obj_12pocketsphinx_Decoder {
380 struct __pyx_vtabstruct_12pocketsphinx_Decoder *__pyx_vtab;
386 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":146
387 * cdef set_lmath(NGramModel self, logmath_t *lmath)
389 * cdef class LogMath: # <<<<<<<<<<<<<<
390 * cdef logmath_t *lmath
394 struct __pyx_obj_10sphinxbase_LogMath {
399 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":173
400 * cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
402 * cdef class LatNodeIterator: # <<<<<<<<<<<<<<
403 * cdef ps_lattice_t *dag
404 * cdef ps_latnode_iter_t *itor
407 struct __pyx_obj_12pocketsphinx_LatNodeIterator {
410 ps_latnode_iter_t *itor;
416 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":144
417 * cdef set_boxed(Decoder self, box)
419 * cdef class Lattice: # <<<<<<<<<<<<<<
420 * cdef ps_lattice_t *dag
421 * cdef read_dag(Lattice self, Decoder ps, latfile)
424 struct __pyx_obj_12pocketsphinx_Lattice {
426 struct __pyx_vtabstruct_12pocketsphinx_Lattice *__pyx_vtab;
431 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":159
432 * cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
434 * cdef class LatLinkIterator: # <<<<<<<<<<<<<<
435 * cdef ps_lattice_t *dag
436 * cdef ps_latlink_iter_t *itor
439 struct __pyx_obj_12pocketsphinx_LatLinkIterator {
442 ps_latlink_iter_t *itor;
446 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":149
447 * cdef logmath_t *lmath
449 * cdef class NGramIter: # <<<<<<<<<<<<<<
451 * cdef ngram_iter_t *itor
454 struct __pyx_obj_10sphinxbase_NGramIter {
456 struct __pyx_vtabstruct_10sphinxbase_NGramIter *__pyx_vtab;
457 struct __pyx_obj_10sphinxbase_NGramModel *lm;
467 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":227
470 * cdef class Lattice: # <<<<<<<<<<<<<<
475 struct __pyx_vtabstruct_12pocketsphinx_Lattice {
476 PyObject *(*read_dag)(struct __pyx_obj_12pocketsphinx_Lattice *, struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *);
477 PyObject *(*set_dag)(struct __pyx_obj_12pocketsphinx_Lattice *, ps_lattice_t *);
478 PyObject *(*set_boxed)(struct __pyx_obj_12pocketsphinx_Lattice *, PyObject *);
480 static struct __pyx_vtabstruct_12pocketsphinx_Lattice *__pyx_vtabptr_12pocketsphinx_Lattice;
483 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":132
486 * cdef class LatLink: # <<<<<<<<<<<<<<
488 * Link (edge) in a word lattice, connecting two nodes.
491 struct __pyx_vtabstruct_12pocketsphinx_LatLink {
492 PyObject *(*set_link)(struct __pyx_obj_12pocketsphinx_LatLink *, ps_lattice_t *, ps_latlink_t *);
494 static struct __pyx_vtabstruct_12pocketsphinx_LatLink *__pyx_vtabptr_12pocketsphinx_LatLink;
497 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":149
498 * cdef logmath_t *lmath
500 * cdef class NGramIter: # <<<<<<<<<<<<<<
502 * cdef ngram_iter_t *itor
505 struct __pyx_vtabstruct_10sphinxbase_NGramIter {
506 PyObject *(*set_iter)(struct __pyx_obj_10sphinxbase_NGramIter *, ngram_iter_t *);
508 static struct __pyx_vtabstruct_10sphinxbase_NGramIter *__pyx_vtabptr_10sphinxbase_NGramIter;
511 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":371
512 * raise RuntimeError, "Failed to write lattice to %s" % outfile
514 * cdef class Decoder: # <<<<<<<<<<<<<<
516 * PocketSphinx speech decoder.
519 struct __pyx_vtabstruct_12pocketsphinx_Decoder {
520 PyObject *(*set_boxed)(struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *);
522 static struct __pyx_vtabstruct_12pocketsphinx_Decoder *__pyx_vtabptr_12pocketsphinx_Decoder;
525 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":10
526 * # Author: David Huggins-Daines <dhuggins@cs.cmu.edu>
528 * cdef class LatNode: # <<<<<<<<<<<<<<
530 * Node in a word lattice.
533 struct __pyx_vtabstruct_12pocketsphinx_LatNode {
534 PyObject *(*set_node)(struct __pyx_obj_12pocketsphinx_LatNode *, ps_lattice_t *, ps_latnode_t *);
536 static struct __pyx_vtabstruct_12pocketsphinx_LatNode *__pyx_vtabptr_12pocketsphinx_LatNode;
539 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":138
541 * # Extension classes
542 * cdef class NGramModel: # <<<<<<<<<<<<<<
543 * cdef ngram_model_t *lm
544 * cdef logmath_t *lmath
547 struct __pyx_vtabstruct_10sphinxbase_NGramModel {
548 PyObject *(*set_lm)(struct __pyx_obj_10sphinxbase_NGramModel *, ngram_model_t *);
549 PyObject *(*set_lmath)(struct __pyx_obj_10sphinxbase_NGramModel *, logmath_t *);
551 static struct __pyx_vtabstruct_10sphinxbase_NGramModel *__pyx_vtabptr_10sphinxbase_NGramModel;
553 #ifndef CYTHON_REFNANNY
554 #define CYTHON_REFNANNY 0
559 void (*INCREF)(void*, PyObject*, int);
560 void (*DECREF)(void*, PyObject*, int);
561 void (*GOTREF)(void*, PyObject*, int);
562 void (*GIVEREF)(void*, PyObject*, int);
563 void* (*SetupContext)(const char*, int, const char*);
564 void (*FinishContext)(void**);
565 } __Pyx_RefNannyAPIStruct;
566 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
567 static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
568 PyObject *m = NULL, *p = NULL;
570 m = PyImport_ImportModule((char *)modname);
572 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
574 r = PyLong_AsVoidPtr(p);
578 return (__Pyx_RefNannyAPIStruct *)r;
580 #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
581 #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
582 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
583 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
584 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
585 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
586 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
588 #define __Pyx_RefNannySetupContext(name)
589 #define __Pyx_RefNannyFinishContext()
590 #define __Pyx_INCREF(r) Py_INCREF(r)
591 #define __Pyx_DECREF(r) Py_DECREF(r)
592 #define __Pyx_GOTREF(r)
593 #define __Pyx_GIVEREF(r)
594 #define __Pyx_XDECREF(r) Py_XDECREF(r)
595 #endif /* CYTHON_REFNANNY */
596 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
597 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
599 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
601 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
602 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
604 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
605 const char* function_name, int kw_allowed); /*proto*/
607 static void __Pyx_RaiseDoubleKeywordsError(
608 const char* func_name, PyObject* kw_name); /*proto*/
610 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
612 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
614 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
615 const char *name, int exact); /*proto*/
617 static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
618 static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
619 return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
622 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
624 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
627 #if PY_MAJOR_VERSION >= 3
628 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
630 if (unlikely(d == Py_None)) {
631 __Pyx_RaiseNoneIndexingError();
634 value = PyDict_GetItemWithError(d, key);
635 if (unlikely(!value)) {
636 if (!PyErr_Occurred())
637 PyErr_SetObject(PyExc_KeyError, key);
644 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
648 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
651 r = PyObject_GetItem(o, j);
657 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
658 __Pyx_GetItemInt_List_Fast(o, i) : \
659 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
661 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
662 if (likely(o != Py_None)) {
663 if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
664 PyObject *r = PyList_GET_ITEM(o, i);
668 else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
669 PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
674 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
677 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
678 __Pyx_GetItemInt_Tuple_Fast(o, i) : \
679 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
681 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
682 if (likely(o != Py_None)) {
683 if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
684 PyObject *r = PyTuple_GET_ITEM(o, i);
688 else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
689 PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
694 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
698 #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
699 __Pyx_GetItemInt_Fast(o, i) : \
700 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
702 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
704 if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
705 r = PyList_GET_ITEM(o, i);
708 else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
709 r = PyTuple_GET_ITEM(o, i);
712 else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
713 r = PySequence_GetItem(o, i);
716 r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
721 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
722 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
724 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
726 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
728 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
730 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
732 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
734 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
736 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
738 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
740 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
742 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
744 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
746 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
748 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
750 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
752 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
754 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
756 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
758 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
760 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/
762 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
764 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
766 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
768 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
769 /* Module declarations from sphinxbase */
771 static PyTypeObject *__pyx_ptype_10sphinxbase_NGramModel = 0;
772 static PyTypeObject *__pyx_ptype_10sphinxbase_LogMath = 0;
773 static PyTypeObject *__pyx_ptype_10sphinxbase_NGramIter = 0;
774 static PyTypeObject *__pyx_ptype_10sphinxbase_HuffCode = 0;
775 /* Module declarations from pocketsphinx */
777 static PyTypeObject *__pyx_ptype_12pocketsphinx_Decoder = 0;
778 static PyTypeObject *__pyx_ptype_12pocketsphinx_Lattice = 0;
779 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatLink = 0;
780 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatLinkIterator = 0;
781 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatNode = 0;
782 static PyTypeObject *__pyx_ptype_12pocketsphinx_LatNodeIterator = 0;
783 #define __Pyx_MODULE_NAME "pocketsphinx"
784 int __pyx_module_is_main_pocketsphinx = 0;
786 /* Implementation of pocketsphinx */
787 static PyObject *__pyx_builtin_StopIteration;
788 static PyObject *__pyx_builtin_RuntimeError;
789 static char __pyx_k_1[] = "Failed to read lattice from %s";
790 static char __pyx_k_2[] = "Failed to write lattice to %s";
791 static char __pyx_k_3[] = "-";
792 static char __pyx_k_4[] = "Failed to parse argument list";
793 static char __pyx_k_5[] = "Failed to initialize PocketSphinx";
794 static char __pyx_k_6[] = "Failed to start utterance processing";
795 static char __pyx_k_9[] = "Failed to process %d samples of audio data";
796 static char __pyx_k_10[] = "Failed to stop utterance processing";
797 static char __pyx_k_11[] = "Failed to create word lattice";
798 static char __pyx_k_12[] = "-lw";
799 static char __pyx_k_13[] = "-wip";
800 static char __pyx_k_14[] = "-uw";
801 static char __pyx_k_16[] = "LatNode.exits (line 53)";
802 static char __pyx_k_17[] = "LatNode.entries (line 69)";
803 static char __pyx_k_18[] = "LatNodeIterator.__next__ (line 98)";
804 static char __pyx_k_19[] = "LatLink.nodes (line 164)";
805 static char __pyx_k_20[] = "LatLink.pred (line 181)";
806 static char __pyx_k_21[] = "LatLinkIterator.__next__ (line 209)";
807 static char __pyx_k_22[] = "Lattice.bestpath (line 287)";
808 static char __pyx_k_23[] = "Lattice.posterior (line 317)";
809 static char __pyx_k_24[] = "Lattice.nodes (line 338)";
810 static char __pyx_k_25[] = "Lattice.write (line 358)";
811 static char __pyx_k_26[] = "Decoder.decode_raw (line 441)";
812 static char __pyx_k_27[] = "Decoder.decode_senscr (line 464)";
813 static char __pyx_k_28[] = "Decoder.start_utt (line 483)";
814 static char __pyx_k_29[] = "Decoder.process_raw (line 499)";
815 static char __pyx_k_30[] = "Decoder.ps_end_utt (line 525)";
816 static char __pyx_k_31[] = "Decoder.get_hyp (line 532)";
817 static char __pyx_k_32[] = "Decoder.get_prob (line 555)";
818 static char __pyx_k_33[] = "Decoder.get_lattice (line 569)";
819 static char __pyx_k_34[] = "Decoder.get_lmset (line 589)";
820 static char __pyx_k_35[] = "Decoder.add_word (line 616)";
821 static char __pyx_k_36[] = "Decoder.load_dict (line 631)";
822 static char __pyx_k_37[] = "Decoder.save_dict (line 644)";
823 static char __pyx_k__ef[] = "ef";
824 static char __pyx_k__fh[] = "fh";
825 static char __pyx_k__lm[] = "lm";
826 static char __pyx_k__lw[] = "lw";
827 static char __pyx_k__ps[] = "ps";
828 static char __pyx_k__sf[] = "sf";
829 static char __pyx_k__uw[] = "uw";
830 static char __pyx_k__dag[] = "dag";
831 static char __pyx_k__end[] = "end";
832 static char __pyx_k__fef[] = "fef";
833 static char __pyx_k__lef[] = "lef";
834 static char __pyx_k__lwf[] = "lwf";
835 static char __pyx_k__wip[] = "wip";
836 static char __pyx_k__argc[] = "argc";
837 static char __pyx_k__argv[] = "argv";
838 static char __pyx_k__data[] = "data";
839 static char __pyx_k__itor[] = "itor";
840 static char __pyx_k__link[] = "link";
841 static char __pyx_k__node[] = "node";
842 static char __pyx_k__pred[] = "pred";
843 static char __pyx_k__prob[] = "prob";
844 static char __pyx_k__word[] = "word";
845 static char __pyx_k__boxed[] = "boxed";
846 static char __pyx_k__exits[] = "exits";
847 static char __pyx_k__lmset[] = "lmset";
848 static char __pyx_k__nodes[] = "nodes";
849 static char __pyx_k__start[] = "start";
850 static char __pyx_k__uttid[] = "uttid";
851 static char __pyx_k__words[] = "words";
852 static char __pyx_k__write[] = "write";
853 static char __pyx_k__ascale[] = "ascale";
854 static char __pyx_k__format[] = "format";
855 static char __pyx_k__phones[] = "phones";
856 static char __pyx_k__set_lm[] = "set_lm";
857 static char __pyx_k__update[] = "update";
858 static char __pyx_k__Decoder[] = "Decoder";
859 static char __pyx_k__LatLink[] = "LatLink";
860 static char __pyx_k__LatNode[] = "LatNode";
861 static char __pyx_k__Lattice[] = "Lattice";
862 static char __pyx_k__entries[] = "entries";
863 static char __pyx_k__get_hyp[] = "get_hyp";
864 static char __pyx_k__latfile[] = "latfile";
865 static char __pyx_k__set_dag[] = "set_dag";
866 static char __pyx_k____main__[] = "__main__";
867 static char __pyx_k____next__[] = "__next__";
868 static char __pyx_k____test__[] = "__test__";
869 static char __pyx_k__add_word[] = "add_word";
870 static char __pyx_k__baseword[] = "baseword";
871 static char __pyx_k__bestpath[] = "bestpath";
872 static char __pyx_k__dictfile[] = "dictfile";
873 static char __pyx_k__full_utt[] = "full_utt";
874 static char __pyx_k__get_prob[] = "get_prob";
875 static char __pyx_k__log_bowt[] = "log_bowt";
876 static char __pyx_k__log_prob[] = "log_prob";
877 static char __pyx_k__maxsamps[] = "maxsamps";
878 static char __pyx_k__n_frames[] = "n_frames";
879 static char __pyx_k__read_dag[] = "read_dag";
880 static char __pyx_k__set_link[] = "set_link";
881 static char __pyx_k__set_node[] = "set_node";
882 static char __pyx_k__best_exit[] = "best_exit";
883 static char __pyx_k__fdictfile[] = "fdictfile";
884 static char __pyx_k__get_lmset[] = "get_lmset";
885 static char __pyx_k__load_dict[] = "load_dict";
886 static char __pyx_k__no_search[] = "no_search";
887 static char __pyx_k__posterior[] = "posterior";
888 static char __pyx_k__save_dict[] = "save_dict";
889 static char __pyx_k__set_boxed[] = "set_boxed";
890 static char __pyx_k__set_lmath[] = "set_lmath";
891 static char __pyx_k__start_utt[] = "start_utt";
892 static char __pyx_k__decode_raw[] = "decode_raw";
893 static char __pyx_k__first_link[] = "first_link";
894 static char __pyx_k__first_node[] = "first_node";
895 static char __pyx_k__ps_end_utt[] = "ps_end_utt";
896 static char __pyx_k__get_lattice[] = "get_lattice";
897 static char __pyx_k__process_raw[] = "process_raw";
898 static char __pyx_k__RuntimeError[] = "RuntimeError";
899 static char __pyx_k__StopIteration[] = "StopIteration";
900 static char __pyx_k__decode_senscr[] = "decode_senscr";
901 static char __pyx_k__LatLinkIterator[] = "LatLinkIterator";
902 static char __pyx_k__LatNodeIterator[] = "LatNodeIterator";
903 static PyObject *__pyx_kp_s_1;
904 static PyObject *__pyx_kp_s_10;
905 static PyObject *__pyx_kp_s_11;
906 static PyObject *__pyx_kp_u_16;
907 static PyObject *__pyx_kp_u_17;
908 static PyObject *__pyx_kp_u_18;
909 static PyObject *__pyx_kp_u_19;
910 static PyObject *__pyx_kp_s_2;
911 static PyObject *__pyx_kp_u_20;
912 static PyObject *__pyx_kp_u_21;
913 static PyObject *__pyx_kp_u_22;
914 static PyObject *__pyx_kp_u_23;
915 static PyObject *__pyx_kp_u_24;
916 static PyObject *__pyx_kp_u_25;
917 static PyObject *__pyx_kp_u_26;
918 static PyObject *__pyx_kp_u_27;
919 static PyObject *__pyx_kp_u_28;
920 static PyObject *__pyx_kp_u_29;
921 static PyObject *__pyx_kp_s_3;
922 static PyObject *__pyx_kp_u_30;
923 static PyObject *__pyx_kp_u_31;
924 static PyObject *__pyx_kp_u_32;
925 static PyObject *__pyx_kp_u_33;
926 static PyObject *__pyx_kp_u_34;
927 static PyObject *__pyx_kp_u_35;
928 static PyObject *__pyx_kp_u_36;
929 static PyObject *__pyx_kp_u_37;
930 static PyObject *__pyx_kp_s_4;
931 static PyObject *__pyx_kp_s_5;
932 static PyObject *__pyx_kp_s_6;
933 static PyObject *__pyx_kp_s_9;
934 static PyObject *__pyx_n_s__Decoder;
935 static PyObject *__pyx_n_s__LatLink;
936 static PyObject *__pyx_n_s__LatLinkIterator;
937 static PyObject *__pyx_n_s__LatNode;
938 static PyObject *__pyx_n_s__LatNodeIterator;
939 static PyObject *__pyx_n_s__Lattice;
940 static PyObject *__pyx_n_s__RuntimeError;
941 static PyObject *__pyx_n_s__StopIteration;
942 static PyObject *__pyx_n_s____main__;
943 static PyObject *__pyx_n_s____next__;
944 static PyObject *__pyx_n_s____test__;
945 static PyObject *__pyx_n_s__add_word;
946 static PyObject *__pyx_n_s__argc;
947 static PyObject *__pyx_n_s__argv;
948 static PyObject *__pyx_n_s__ascale;
949 static PyObject *__pyx_n_s__baseword;
950 static PyObject *__pyx_n_s__best_exit;
951 static PyObject *__pyx_n_s__bestpath;
952 static PyObject *__pyx_n_s__boxed;
953 static PyObject *__pyx_n_s__dag;
954 static PyObject *__pyx_n_s__data;
955 static PyObject *__pyx_n_s__decode_raw;
956 static PyObject *__pyx_n_s__decode_senscr;
957 static PyObject *__pyx_n_s__dictfile;
958 static PyObject *__pyx_n_s__ef;
959 static PyObject *__pyx_n_s__end;
960 static PyObject *__pyx_n_s__entries;
961 static PyObject *__pyx_n_s__exits;
962 static PyObject *__pyx_n_s__fdictfile;
963 static PyObject *__pyx_n_s__fef;
964 static PyObject *__pyx_n_s__fh;
965 static PyObject *__pyx_n_s__first_link;
966 static PyObject *__pyx_n_s__first_node;
967 static PyObject *__pyx_n_s__format;
968 static PyObject *__pyx_n_s__full_utt;
969 static PyObject *__pyx_n_s__get_hyp;
970 static PyObject *__pyx_n_s__get_lattice;
971 static PyObject *__pyx_n_s__get_lmset;
972 static PyObject *__pyx_n_s__get_prob;
973 static PyObject *__pyx_n_s__itor;
974 static PyObject *__pyx_n_s__latfile;
975 static PyObject *__pyx_n_s__lef;
976 static PyObject *__pyx_n_s__link;
977 static PyObject *__pyx_n_s__lm;
978 static PyObject *__pyx_n_s__lmset;
979 static PyObject *__pyx_n_s__load_dict;
980 static PyObject *__pyx_n_s__log_bowt;
981 static PyObject *__pyx_n_s__log_prob;
982 static PyObject *__pyx_n_s__lw;
983 static PyObject *__pyx_n_s__lwf;
984 static PyObject *__pyx_n_s__maxsamps;
985 static PyObject *__pyx_n_s__n_frames;
986 static PyObject *__pyx_n_s__no_search;
987 static PyObject *__pyx_n_s__node;
988 static PyObject *__pyx_n_s__nodes;
989 static PyObject *__pyx_n_s__phones;
990 static PyObject *__pyx_n_s__posterior;
991 static PyObject *__pyx_n_s__pred;
992 static PyObject *__pyx_n_s__prob;
993 static PyObject *__pyx_n_s__process_raw;
994 static PyObject *__pyx_n_s__ps;
995 static PyObject *__pyx_n_s__ps_end_utt;
996 static PyObject *__pyx_n_s__read_dag;
997 static PyObject *__pyx_n_s__save_dict;
998 static PyObject *__pyx_n_s__set_boxed;
999 static PyObject *__pyx_n_s__set_dag;
1000 static PyObject *__pyx_n_s__set_link;
1001 static PyObject *__pyx_n_s__set_lm;
1002 static PyObject *__pyx_n_s__set_lmath;
1003 static PyObject *__pyx_n_s__set_node;
1004 static PyObject *__pyx_n_s__sf;
1005 static PyObject *__pyx_n_s__start;
1006 static PyObject *__pyx_n_s__start_utt;
1007 static PyObject *__pyx_n_s__update;
1008 static PyObject *__pyx_n_s__uttid;
1009 static PyObject *__pyx_n_s__uw;
1010 static PyObject *__pyx_n_s__wip;
1011 static PyObject *__pyx_n_s__word;
1012 static PyObject *__pyx_n_s__words;
1013 static PyObject *__pyx_n_s__write;
1014 static PyObject *__pyx_int_0;
1015 static PyObject *__pyx_int_neg_1;
1016 static PyObject *__pyx_k_7;
1017 static PyObject *__pyx_k_8;
1018 static PyObject *__pyx_k_15;
1020 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":29
1023 * def __cinit__(self): # <<<<<<<<<<<<<<
1028 static int __pyx_pf_12pocketsphinx_7LatNode___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1029 static int __pyx_pf_12pocketsphinx_7LatNode___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1031 __Pyx_RefNannySetupContext("__cinit__");
1032 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1033 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1034 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
1036 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":30
1038 * def __cinit__(self):
1039 * self.node = NULL # <<<<<<<<<<<<<<
1041 * cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node):
1043 ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node = NULL;
1046 __Pyx_RefNannyFinishContext();
1050 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":32
1053 * cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node): # <<<<<<<<<<<<<<
1055 * Internal function - binds this to a PocketSphinx lattice node.
1058 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) {
1061 ps_latlink_t *__pyx_v_best_exit;
1062 PyObject *__pyx_r = NULL;
1064 PyObject *__pyx_t_2 = NULL;
1065 __Pyx_RefNannySetupContext("set_node");
1067 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":38
1068 * cdef short fef, lef
1069 * cdef ps_latlink_t *best_exit
1070 * self.dag = dag # <<<<<<<<<<<<<<
1072 * self.word = ps_latnode_word(dag, node)
1074 __pyx_v_self->dag = __pyx_v_dag;
1076 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":39
1077 * cdef ps_latlink_t *best_exit
1079 * self.node = node # <<<<<<<<<<<<<<
1080 * self.word = ps_latnode_word(dag, node)
1081 * self.baseword = ps_latnode_baseword(dag, node)
1083 __pyx_v_self->node = __pyx_v_node;
1085 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":40
1088 * self.word = ps_latnode_word(dag, node) # <<<<<<<<<<<<<<
1089 * self.baseword = ps_latnode_baseword(dag, node)
1090 * self.sf = ps_latnode_times(node, &fef, &lef)
1092 __pyx_v_self->word = ps_latnode_word(__pyx_v_dag, __pyx_v_node);
1094 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":41
1096 * self.word = ps_latnode_word(dag, node)
1097 * self.baseword = ps_latnode_baseword(dag, node) # <<<<<<<<<<<<<<
1098 * self.sf = ps_latnode_times(node, &fef, &lef)
1101 __pyx_v_self->baseword = ps_latnode_baseword(__pyx_v_dag, __pyx_v_node);
1103 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":42
1104 * self.word = ps_latnode_word(dag, node)
1105 * self.baseword = ps_latnode_baseword(dag, node)
1106 * self.sf = ps_latnode_times(node, &fef, &lef) # <<<<<<<<<<<<<<
1110 __pyx_v_self->sf = ps_latnode_times(__pyx_v_node, (&__pyx_v_fef), (&__pyx_v_lef));
1112 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":43
1113 * self.baseword = ps_latnode_baseword(dag, node)
1114 * self.sf = ps_latnode_times(node, &fef, &lef)
1115 * self.fef = fef # <<<<<<<<<<<<<<
1117 * self.best_exit = None
1119 __pyx_v_self->fef = __pyx_v_fef;
1121 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":44
1122 * self.sf = ps_latnode_times(node, &fef, &lef)
1124 * self.lef = lef # <<<<<<<<<<<<<<
1125 * self.best_exit = None
1128 __pyx_v_self->lef = __pyx_v_lef;
1130 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":45
1133 * self.best_exit = None # <<<<<<<<<<<<<<
1135 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1137 __Pyx_INCREF(Py_None);
1138 __Pyx_GIVEREF(Py_None);
1139 __Pyx_GOTREF(__pyx_v_self->best_exit);
1140 __Pyx_DECREF(((PyObject *)__pyx_v_self->best_exit));
1141 __pyx_v_self->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None);
1143 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":46
1145 * self.best_exit = None
1146 * best_exit = NULL # <<<<<<<<<<<<<<
1147 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1148 * ps_latnode_prob(dag, node, &best_exit))
1150 __pyx_v_best_exit = NULL;
1152 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":47
1153 * self.best_exit = None
1155 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag), # <<<<<<<<<<<<<<
1156 * ps_latnode_prob(dag, node, &best_exit))
1157 * if best_exit != NULL:
1159 __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)));
1161 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":49
1162 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1163 * ps_latnode_prob(dag, node, &best_exit))
1164 * if best_exit != NULL: # <<<<<<<<<<<<<<
1165 * self.best_exit = LatLink()
1166 * self.best_exit.set_link(dag, best_exit)
1168 __pyx_t_1 = (__pyx_v_best_exit != NULL);
1171 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":50
1172 * ps_latnode_prob(dag, node, &best_exit))
1173 * if best_exit != NULL:
1174 * self.best_exit = LatLink() # <<<<<<<<<<<<<<
1175 * self.best_exit.set_link(dag, best_exit)
1178 __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;}
1179 __Pyx_GOTREF(__pyx_t_2);
1180 __Pyx_GIVEREF(__pyx_t_2);
1181 __Pyx_GOTREF(__pyx_v_self->best_exit);
1182 __Pyx_DECREF(((PyObject *)__pyx_v_self->best_exit));
1183 __pyx_v_self->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
1186 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":51
1187 * if best_exit != NULL:
1188 * self.best_exit = LatLink()
1189 * self.best_exit.set_link(dag, best_exit) # <<<<<<<<<<<<<<
1193 __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;}
1194 __Pyx_GOTREF(__pyx_t_2);
1195 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1200 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1203 __Pyx_XDECREF(__pyx_t_2);
1204 __Pyx_AddTraceback("pocketsphinx.LatNode.set_node");
1207 __Pyx_XGIVEREF(__pyx_r);
1208 __Pyx_RefNannyFinishContext();
1212 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":53
1213 * self.best_exit.set_link(dag, best_exit)
1215 * def exits(self): # <<<<<<<<<<<<<<
1217 * Obtain an iterator over arcs exiting this node.
1220 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_exits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1221 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 ";
1222 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_exits(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1223 struct __pyx_obj_12pocketsphinx_LatLinkIterator *__pyx_v_itor;
1224 ps_latlink_iter_t *__pyx_v_citor;
1225 PyObject *__pyx_r = NULL;
1226 PyObject *__pyx_t_1 = NULL;
1227 __Pyx_RefNannySetupContext("exits");
1228 __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)Py_None); __Pyx_INCREF(Py_None);
1230 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":63
1231 * cdef ps_latlink_iter_t *citor
1233 * citor = ps_latnode_exits(self.node) # <<<<<<<<<<<<<<
1234 * itor = LatLinkIterator()
1237 __pyx_v_citor = ps_latnode_exits(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node);
1239 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":64
1241 * citor = ps_latnode_exits(self.node)
1242 * itor = LatLinkIterator() # <<<<<<<<<<<<<<
1244 * itor.dag = self.dag
1246 __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;}
1247 __Pyx_GOTREF(__pyx_t_1);
1248 __Pyx_DECREF(((PyObject *)__pyx_v_itor));
1249 __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_t_1);
1252 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":65
1253 * citor = ps_latnode_exits(self.node)
1254 * itor = LatLinkIterator()
1255 * itor.itor = citor # <<<<<<<<<<<<<<
1256 * itor.dag = self.dag
1259 __pyx_v_itor->itor = __pyx_v_citor;
1261 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":66
1262 * itor = LatLinkIterator()
1264 * itor.dag = self.dag # <<<<<<<<<<<<<<
1268 __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->dag;
1270 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":67
1272 * itor.dag = self.dag
1273 * return itor # <<<<<<<<<<<<<<
1275 * def entries(self):
1277 __Pyx_XDECREF(__pyx_r);
1278 __Pyx_INCREF(((PyObject *)__pyx_v_itor));
1279 __pyx_r = ((PyObject *)__pyx_v_itor);
1282 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1285 __Pyx_XDECREF(__pyx_t_1);
1286 __Pyx_AddTraceback("pocketsphinx.LatNode.exits");
1289 __Pyx_DECREF((PyObject *)__pyx_v_itor);
1290 __Pyx_XGIVEREF(__pyx_r);
1291 __Pyx_RefNannyFinishContext();
1295 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":69
1298 * def entries(self): # <<<<<<<<<<<<<<
1300 * Obtain an iterator over arcs entering this node.
1303 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_entries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1304 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 ";
1305 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_entries(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1306 struct __pyx_obj_12pocketsphinx_LatLinkIterator *__pyx_v_itor;
1307 ps_latlink_iter_t *__pyx_v_citor;
1308 PyObject *__pyx_r = NULL;
1309 PyObject *__pyx_t_1 = NULL;
1310 __Pyx_RefNannySetupContext("entries");
1311 __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)Py_None); __Pyx_INCREF(Py_None);
1313 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":79
1314 * cdef ps_latlink_iter_t *citor
1316 * citor = ps_latnode_entries(self.node) # <<<<<<<<<<<<<<
1317 * itor = LatLinkIterator()
1320 __pyx_v_citor = ps_latnode_entries(((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->node);
1322 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":80
1324 * citor = ps_latnode_entries(self.node)
1325 * itor = LatLinkIterator() # <<<<<<<<<<<<<<
1327 * itor.dag = self.dag
1329 __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;}
1330 __Pyx_GOTREF(__pyx_t_1);
1331 __Pyx_DECREF(((PyObject *)__pyx_v_itor));
1332 __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_t_1);
1335 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":81
1336 * citor = ps_latnode_entries(self.node)
1337 * itor = LatLinkIterator()
1338 * itor.itor = citor # <<<<<<<<<<<<<<
1339 * itor.dag = self.dag
1342 __pyx_v_itor->itor = __pyx_v_citor;
1344 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":82
1345 * itor = LatLinkIterator()
1347 * itor.dag = self.dag # <<<<<<<<<<<<<<
1351 __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->dag;
1353 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":83
1355 * itor.dag = self.dag
1356 * return itor # <<<<<<<<<<<<<<
1358 * cdef class LatNodeIterator:
1360 __Pyx_XDECREF(__pyx_r);
1361 __Pyx_INCREF(((PyObject *)__pyx_v_itor));
1362 __pyx_r = ((PyObject *)__pyx_v_itor);
1365 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1368 __Pyx_XDECREF(__pyx_t_1);
1369 __Pyx_AddTraceback("pocketsphinx.LatNode.entries");
1372 __Pyx_DECREF((PyObject *)__pyx_v_itor);
1373 __Pyx_XGIVEREF(__pyx_r);
1374 __Pyx_RefNannyFinishContext();
1378 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":89
1379 * Iterator over word lattice nodes.
1381 * def __init__(self, start, end): # <<<<<<<<<<<<<<
1383 * self.first_node = True
1386 static int __pyx_pf_12pocketsphinx_15LatNodeIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1387 static int __pyx_pf_12pocketsphinx_15LatNodeIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1388 PyObject *__pyx_v_start = 0;
1389 PyObject *__pyx_v_end = 0;
1392 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
1393 __Pyx_RefNannySetupContext("__init__");
1394 if (unlikely(__pyx_kwds)) {
1395 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1396 PyObject* values[2] = {0,0};
1397 switch (PyTuple_GET_SIZE(__pyx_args)) {
1398 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1399 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1401 default: goto __pyx_L5_argtuple_error;
1403 switch (PyTuple_GET_SIZE(__pyx_args)) {
1405 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
1406 if (likely(values[0])) kw_args--;
1407 else goto __pyx_L5_argtuple_error;
1409 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
1410 if (likely(values[1])) kw_args--;
1412 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1415 if (unlikely(kw_args > 0)) {
1416 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;}
1418 __pyx_v_start = values[0];
1419 __pyx_v_end = values[1];
1420 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1421 goto __pyx_L5_argtuple_error;
1423 __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
1424 __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
1426 goto __pyx_L4_argument_unpacking_done;
1427 __pyx_L5_argtuple_error:;
1428 __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;}
1430 __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__init__");
1431 __Pyx_RefNannyFinishContext();
1433 __pyx_L4_argument_unpacking_done:;
1435 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":90
1437 * def __init__(self, start, end):
1438 * self.itor = NULL # <<<<<<<<<<<<<<
1439 * self.first_node = True
1440 * self.start = start
1442 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = NULL;
1444 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":91
1445 * def __init__(self, start, end):
1447 * self.first_node = True # <<<<<<<<<<<<<<
1448 * self.start = start
1451 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node = 1;
1453 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":92
1455 * self.first_node = True
1456 * self.start = start # <<<<<<<<<<<<<<
1460 __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;}
1461 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->start = __pyx_t_1;
1463 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":93
1464 * self.first_node = True
1465 * self.start = start
1466 * self.end = end # <<<<<<<<<<<<<<
1468 * def __iter__(self):
1470 __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;}
1471 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->end = __pyx_t_1;
1476 __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__init__");
1479 __Pyx_RefNannyFinishContext();
1483 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":95
1486 * def __iter__(self): # <<<<<<<<<<<<<<
1491 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___iter__(PyObject *__pyx_v_self); /*proto*/
1492 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___iter__(PyObject *__pyx_v_self) {
1493 PyObject *__pyx_r = NULL;
1494 __Pyx_RefNannySetupContext("__iter__");
1496 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":96
1498 * def __iter__(self):
1499 * return self # <<<<<<<<<<<<<<
1501 * def __next__(self):
1503 __Pyx_XDECREF(__pyx_r);
1504 __Pyx_INCREF(__pyx_v_self);
1505 __pyx_r = __pyx_v_self;
1508 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1510 __Pyx_XGIVEREF(__pyx_r);
1511 __Pyx_RefNannyFinishContext();
1515 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":98
1518 * def __next__(self): # <<<<<<<<<<<<<<
1520 * Advance iterator and return the next node.
1523 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___next__(PyObject *__pyx_v_self); /*proto*/
1524 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 ";
1525 struct wrapperbase __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__;
1526 static PyObject *__pyx_pf_12pocketsphinx_15LatNodeIterator___next__(PyObject *__pyx_v_self) {
1527 struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_node;
1529 ps_latnode_t *__pyx_v_cnode;
1530 PyObject *__pyx_r = NULL;
1534 PyObject *__pyx_t_4 = NULL;
1535 __Pyx_RefNannySetupContext("__next__");
1536 __pyx_v_node = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
1538 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":110
1540 * # Make sure we keep raising exceptions at the end
1541 * if self.itor == NULL: # <<<<<<<<<<<<<<
1542 * raise StopIteration
1543 * # Advance the iterator if this isn't the first item
1545 __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
1548 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":111
1549 * # Make sure we keep raising exceptions at the end
1550 * if self.itor == NULL:
1551 * raise StopIteration # <<<<<<<<<<<<<<
1552 * # Advance the iterator if this isn't the first item
1553 * if self.first_node:
1555 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
1556 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1561 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":113
1562 * raise StopIteration
1563 * # Advance the iterator if this isn't the first item
1564 * if self.first_node: # <<<<<<<<<<<<<<
1565 * self.first_node = False
1568 if (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node) {
1570 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":114
1571 * # Advance the iterator if this isn't the first item
1572 * if self.first_node:
1573 * self.first_node = False # <<<<<<<<<<<<<<
1575 * self.itor = ps_latnode_iter_next(self.itor)
1577 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->first_node = 0;
1582 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":116
1583 * self.first_node = False
1585 * self.itor = ps_latnode_iter_next(self.itor) # <<<<<<<<<<<<<<
1586 * if self.itor == NULL:
1587 * raise StopIteration
1589 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = ps_latnode_iter_next(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1591 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":117
1593 * self.itor = ps_latnode_iter_next(self.itor)
1594 * if self.itor == NULL: # <<<<<<<<<<<<<<
1595 * raise StopIteration
1596 * # Look for the next node within the given time range
1598 __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
1601 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":118
1602 * self.itor = ps_latnode_iter_next(self.itor)
1603 * if self.itor == NULL:
1604 * raise StopIteration # <<<<<<<<<<<<<<
1605 * # Look for the next node within the given time range
1606 * cnode = ps_latnode_iter_node(self.itor)
1608 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
1609 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1616 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":120
1617 * raise StopIteration
1618 * # Look for the next node within the given time range
1619 * cnode = ps_latnode_iter_node(self.itor) # <<<<<<<<<<<<<<
1620 * start = ps_latnode_times(cnode, NULL, NULL)
1621 * while start < self.start or start >= self.end:
1623 __pyx_v_cnode = ps_latnode_iter_node(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1625 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":121
1626 * # Look for the next node within the given time range
1627 * cnode = ps_latnode_iter_node(self.itor)
1628 * start = ps_latnode_times(cnode, NULL, NULL) # <<<<<<<<<<<<<<
1629 * while start < self.start or start >= self.end:
1630 * self.itor = ps_latnode_iter_next(self.itor)
1632 __pyx_v_start = ps_latnode_times(__pyx_v_cnode, NULL, NULL);
1634 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":122
1635 * cnode = ps_latnode_iter_node(self.itor)
1636 * start = ps_latnode_times(cnode, NULL, NULL)
1637 * while start < self.start or start >= self.end: # <<<<<<<<<<<<<<
1638 * self.itor = ps_latnode_iter_next(self.itor)
1639 * if self.itor == NULL:
1642 __pyx_t_1 = (__pyx_v_start < ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->start);
1644 __pyx_t_2 = (__pyx_v_start >= ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->end);
1645 __pyx_t_3 = __pyx_t_2;
1647 __pyx_t_3 = __pyx_t_1;
1649 if (!__pyx_t_3) break;
1651 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":123
1652 * start = ps_latnode_times(cnode, NULL, NULL)
1653 * while start < self.start or start >= self.end:
1654 * self.itor = ps_latnode_iter_next(self.itor) # <<<<<<<<<<<<<<
1655 * if self.itor == NULL:
1656 * raise StopIteration
1658 ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor = ps_latnode_iter_next(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1660 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":124
1661 * while start < self.start or start >= self.end:
1662 * self.itor = ps_latnode_iter_next(self.itor)
1663 * if self.itor == NULL: # <<<<<<<<<<<<<<
1664 * raise StopIteration
1665 * cnode = ps_latnode_iter_node(self.itor)
1667 __pyx_t_3 = (((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor == NULL);
1670 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":125
1671 * self.itor = ps_latnode_iter_next(self.itor)
1672 * if self.itor == NULL:
1673 * raise StopIteration # <<<<<<<<<<<<<<
1674 * cnode = ps_latnode_iter_node(self.itor)
1675 * start = ps_latnode_times(cnode, NULL, NULL)
1677 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
1678 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1683 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":126
1684 * if self.itor == NULL:
1685 * raise StopIteration
1686 * cnode = ps_latnode_iter_node(self.itor) # <<<<<<<<<<<<<<
1687 * start = ps_latnode_times(cnode, NULL, NULL)
1690 __pyx_v_cnode = ps_latnode_iter_node(((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_v_self)->itor);
1692 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":127
1693 * raise StopIteration
1694 * cnode = ps_latnode_iter_node(self.itor)
1695 * start = ps_latnode_times(cnode, NULL, NULL) # <<<<<<<<<<<<<<
1697 * node.set_node(self.dag, cnode)
1699 __pyx_v_start = ps_latnode_times(__pyx_v_cnode, NULL, NULL);
1702 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":128
1703 * cnode = ps_latnode_iter_node(self.itor)
1704 * start = ps_latnode_times(cnode, NULL, NULL)
1705 * node = LatNode() # <<<<<<<<<<<<<<
1706 * node.set_node(self.dag, cnode)
1709 __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;}
1710 __Pyx_GOTREF(__pyx_t_4);
1711 __Pyx_DECREF(((PyObject *)__pyx_v_node));
1712 __pyx_v_node = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_4);
1715 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":129
1716 * start = ps_latnode_times(cnode, NULL, NULL)
1718 * node.set_node(self.dag, cnode) # <<<<<<<<<<<<<<
1722 __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;}
1723 __Pyx_GOTREF(__pyx_t_4);
1724 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1726 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":130
1728 * node.set_node(self.dag, cnode)
1729 * return node # <<<<<<<<<<<<<<
1731 * cdef class LatLink:
1733 __Pyx_XDECREF(__pyx_r);
1734 __Pyx_INCREF(((PyObject *)__pyx_v_node));
1735 __pyx_r = ((PyObject *)__pyx_v_node);
1738 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1741 __Pyx_XDECREF(__pyx_t_4);
1742 __Pyx_AddTraceback("pocketsphinx.LatNodeIterator.__next__");
1745 __Pyx_DECREF((PyObject *)__pyx_v_node);
1746 __Pyx_XGIVEREF(__pyx_r);
1747 __Pyx_RefNannyFinishContext();
1751 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":147
1754 * def __cinit__(self): # <<<<<<<<<<<<<<
1759 static int __pyx_pf_12pocketsphinx_7LatLink___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1760 static int __pyx_pf_12pocketsphinx_7LatLink___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1762 __Pyx_RefNannySetupContext("__cinit__");
1763 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1764 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1765 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
1767 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":148
1769 * def __cinit__(self):
1770 * self.link = NULL # <<<<<<<<<<<<<<
1772 * cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link):
1774 ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link = NULL;
1777 __Pyx_RefNannyFinishContext();
1781 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":150
1784 * cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link): # <<<<<<<<<<<<<<
1786 * Internal function - binds this to a PocketSphinx lattice link.
1789 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) {
1791 PyObject *__pyx_r = NULL;
1792 __Pyx_RefNannySetupContext("set_link");
1794 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":155
1797 * self.dag = dag # <<<<<<<<<<<<<<
1799 * self.word = ps_latlink_word(dag, link)
1801 __pyx_v_self->dag = __pyx_v_dag;
1803 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":156
1806 * self.link = link # <<<<<<<<<<<<<<
1807 * self.word = ps_latlink_word(dag, link)
1808 * self.baseword = ps_latlink_baseword(dag, link)
1810 __pyx_v_self->link = __pyx_v_link;
1812 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":157
1815 * self.word = ps_latlink_word(dag, link) # <<<<<<<<<<<<<<
1816 * self.baseword = ps_latlink_baseword(dag, link)
1817 * self.ef = ps_latlink_times(link, &sf)
1819 __pyx_v_self->word = ps_latlink_word(__pyx_v_dag, __pyx_v_link);
1821 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":158
1823 * self.word = ps_latlink_word(dag, link)
1824 * self.baseword = ps_latlink_baseword(dag, link) # <<<<<<<<<<<<<<
1825 * self.ef = ps_latlink_times(link, &sf)
1828 __pyx_v_self->baseword = ps_latlink_baseword(__pyx_v_dag, __pyx_v_link);
1830 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":159
1831 * self.word = ps_latlink_word(dag, link)
1832 * self.baseword = ps_latlink_baseword(dag, link)
1833 * self.ef = ps_latlink_times(link, &sf) # <<<<<<<<<<<<<<
1835 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1837 __pyx_v_self->ef = ps_latlink_times(__pyx_v_link, (&__pyx_v_sf));
1839 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":160
1840 * self.baseword = ps_latlink_baseword(dag, link)
1841 * self.ef = ps_latlink_times(link, &sf)
1842 * self.sf = sf # <<<<<<<<<<<<<<
1843 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag),
1844 * ps_latlink_prob(dag, link, NULL))
1846 __pyx_v_self->sf = __pyx_v_sf;
1848 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":161
1849 * self.ef = ps_latlink_times(link, &sf)
1851 * self.prob = sb.logmath_log_to_ln(ps_lattice_get_logmath(dag), # <<<<<<<<<<<<<<
1852 * ps_latlink_prob(dag, link, NULL))
1855 __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));
1857 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1858 __Pyx_XGIVEREF(__pyx_r);
1859 __Pyx_RefNannyFinishContext();
1863 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":164
1864 * ps_latlink_prob(dag, link, NULL))
1866 * def nodes(self): # <<<<<<<<<<<<<<
1868 * Get source and destination nodes for this link.
1871 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1872 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 ";
1873 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1874 struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_src;
1875 struct __pyx_obj_12pocketsphinx_LatNode *__pyx_v_dest;
1876 ps_latnode_t *__pyx_v_csrc;
1877 ps_latnode_t *__pyx_v_cdest;
1878 PyObject *__pyx_r = NULL;
1879 PyObject *__pyx_t_1 = NULL;
1880 __Pyx_RefNannySetupContext("nodes");
1881 __pyx_v_src = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
1882 __pyx_v_dest = ((struct __pyx_obj_12pocketsphinx_LatNode *)Py_None); __Pyx_INCREF(Py_None);
1884 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":174
1885 * cdef ps_latnode_t *csrc, *cdest
1887 * cdest = ps_latlink_nodes(self.link, &csrc) # <<<<<<<<<<<<<<
1889 * src.set_node(self.dag, csrc)
1891 __pyx_v_cdest = ps_latlink_nodes(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link, (&__pyx_v_csrc));
1893 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":175
1895 * cdest = ps_latlink_nodes(self.link, &csrc)
1896 * src = LatNode() # <<<<<<<<<<<<<<
1897 * src.set_node(self.dag, csrc)
1900 __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;}
1901 __Pyx_GOTREF(__pyx_t_1);
1902 __Pyx_DECREF(((PyObject *)__pyx_v_src));
1903 __pyx_v_src = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_1);
1906 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":176
1907 * cdest = ps_latlink_nodes(self.link, &csrc)
1909 * src.set_node(self.dag, csrc) # <<<<<<<<<<<<<<
1911 * dest.set_node(self.dag, cdest)
1913 __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;}
1914 __Pyx_GOTREF(__pyx_t_1);
1915 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1917 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":177
1919 * src.set_node(self.dag, csrc)
1920 * dest = LatNode() # <<<<<<<<<<<<<<
1921 * dest.set_node(self.dag, cdest)
1924 __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;}
1925 __Pyx_GOTREF(__pyx_t_1);
1926 __Pyx_DECREF(((PyObject *)__pyx_v_dest));
1927 __pyx_v_dest = ((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_t_1);
1930 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":178
1931 * src.set_node(self.dag, csrc)
1933 * dest.set_node(self.dag, cdest) # <<<<<<<<<<<<<<
1937 __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;}
1938 __Pyx_GOTREF(__pyx_t_1);
1939 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1941 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":179
1943 * dest.set_node(self.dag, cdest)
1944 * return src, dest # <<<<<<<<<<<<<<
1948 __Pyx_XDECREF(__pyx_r);
1949 __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;}
1950 __Pyx_GOTREF(__pyx_t_1);
1951 __Pyx_INCREF(((PyObject *)__pyx_v_src));
1952 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_src));
1953 __Pyx_GIVEREF(((PyObject *)__pyx_v_src));
1954 __Pyx_INCREF(((PyObject *)__pyx_v_dest));
1955 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_dest));
1956 __Pyx_GIVEREF(((PyObject *)__pyx_v_dest));
1957 __pyx_r = __pyx_t_1;
1961 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1964 __Pyx_XDECREF(__pyx_t_1);
1965 __Pyx_AddTraceback("pocketsphinx.LatLink.nodes");
1968 __Pyx_DECREF((PyObject *)__pyx_v_src);
1969 __Pyx_DECREF((PyObject *)__pyx_v_dest);
1970 __Pyx_XGIVEREF(__pyx_r);
1971 __Pyx_RefNannyFinishContext();
1975 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":181
1978 * def pred(self): # <<<<<<<<<<<<<<
1980 * Get backpointer from this link.
1983 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_pred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1984 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 ";
1985 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_pred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1986 struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_pred;
1987 ps_latlink_t *__pyx_v_cpred;
1988 PyObject *__pyx_r = NULL;
1990 PyObject *__pyx_t_2 = NULL;
1991 __Pyx_RefNannySetupContext("pred");
1992 __pyx_v_pred = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
1994 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":191
1995 * cdef ps_latlink_t *cpred
1997 * cpred = ps_latlink_pred(self.link) # <<<<<<<<<<<<<<
2001 __pyx_v_cpred = ps_latlink_pred(((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_v_self)->link);
2003 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":192
2005 * cpred = ps_latlink_pred(self.link)
2006 * if cpred == NULL: # <<<<<<<<<<<<<<
2010 __pyx_t_1 = (__pyx_v_cpred == NULL);
2013 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":193
2014 * cpred = ps_latlink_pred(self.link)
2016 * return None # <<<<<<<<<<<<<<
2018 * pred.set_link(self.dag, cpred)
2020 __Pyx_XDECREF(__pyx_r);
2021 __Pyx_INCREF(Py_None);
2028 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":194
2031 * pred = LatLink() # <<<<<<<<<<<<<<
2032 * pred.set_link(self.dag, cpred)
2035 __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;}
2036 __Pyx_GOTREF(__pyx_t_2);
2037 __Pyx_DECREF(((PyObject *)__pyx_v_pred));
2038 __pyx_v_pred = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
2041 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":195
2044 * pred.set_link(self.dag, cpred) # <<<<<<<<<<<<<<
2048 __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;}
2049 __Pyx_GOTREF(__pyx_t_2);
2050 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2052 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":196
2054 * pred.set_link(self.dag, cpred)
2055 * return pred # <<<<<<<<<<<<<<
2057 * cdef class LatLinkIterator:
2059 __Pyx_XDECREF(__pyx_r);
2060 __Pyx_INCREF(((PyObject *)__pyx_v_pred));
2061 __pyx_r = ((PyObject *)__pyx_v_pred);
2064 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2067 __Pyx_XDECREF(__pyx_t_2);
2068 __Pyx_AddTraceback("pocketsphinx.LatLink.pred");
2071 __Pyx_DECREF((PyObject *)__pyx_v_pred);
2072 __Pyx_XGIVEREF(__pyx_r);
2073 __Pyx_RefNannyFinishContext();
2077 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":202
2078 * Iterator over word lattice links.
2080 * def __cinit__(self): # <<<<<<<<<<<<<<
2082 * self.first_link = True
2085 static int __pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2086 static int __pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2088 __Pyx_RefNannySetupContext("__cinit__");
2089 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2090 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
2091 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2093 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":203
2095 * def __cinit__(self):
2096 * self.itor = NULL # <<<<<<<<<<<<<<
2097 * self.first_link = True
2100 ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor = NULL;
2102 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":204
2103 * def __cinit__(self):
2105 * self.first_link = True # <<<<<<<<<<<<<<
2107 * def __iter__(self):
2109 ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link = 1;
2112 __Pyx_RefNannyFinishContext();
2116 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":206
2117 * self.first_link = True
2119 * def __iter__(self): # <<<<<<<<<<<<<<
2124 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___iter__(PyObject *__pyx_v_self); /*proto*/
2125 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___iter__(PyObject *__pyx_v_self) {
2126 PyObject *__pyx_r = NULL;
2127 __Pyx_RefNannySetupContext("__iter__");
2129 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":207
2131 * def __iter__(self):
2132 * return self # <<<<<<<<<<<<<<
2134 * def __next__(self):
2136 __Pyx_XDECREF(__pyx_r);
2137 __Pyx_INCREF(__pyx_v_self);
2138 __pyx_r = __pyx_v_self;
2141 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2143 __Pyx_XGIVEREF(__pyx_r);
2144 __Pyx_RefNannyFinishContext();
2148 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":209
2151 * def __next__(self): # <<<<<<<<<<<<<<
2153 * Advance iterator and return the next link.
2156 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___next__(PyObject *__pyx_v_self); /*proto*/
2157 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 ";
2158 struct wrapperbase __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__;
2159 static PyObject *__pyx_pf_12pocketsphinx_15LatLinkIterator___next__(PyObject *__pyx_v_self) {
2160 struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_link;
2161 PyObject *__pyx_r = NULL;
2163 PyObject *__pyx_t_2 = NULL;
2164 __Pyx_RefNannySetupContext("__next__");
2165 __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
2167 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":217
2170 * if self.first_link: # <<<<<<<<<<<<<<
2171 * self.first_link = False
2174 if (((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link) {
2176 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":218
2178 * if self.first_link:
2179 * self.first_link = False # <<<<<<<<<<<<<<
2181 * self.itor = ps_latlink_iter_next(self.itor)
2183 ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->first_link = 0;
2188 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":220
2189 * self.first_link = False
2191 * self.itor = ps_latlink_iter_next(self.itor) # <<<<<<<<<<<<<<
2192 * if self.itor == NULL:
2193 * raise StopIteration
2195 ((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor = ps_latlink_iter_next(((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor);
2199 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":221
2201 * self.itor = ps_latlink_iter_next(self.itor)
2202 * if self.itor == NULL: # <<<<<<<<<<<<<<
2203 * raise StopIteration
2206 __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_LatLinkIterator *)__pyx_v_self)->itor == NULL);
2209 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":222
2210 * self.itor = ps_latlink_iter_next(self.itor)
2211 * if self.itor == NULL:
2212 * raise StopIteration # <<<<<<<<<<<<<<
2214 * link.set_link(self.dag, ps_latlink_iter_link(self.itor))
2216 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
2217 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2222 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":223
2223 * if self.itor == NULL:
2224 * raise StopIteration
2225 * link = LatLink() # <<<<<<<<<<<<<<
2226 * link.set_link(self.dag, ps_latlink_iter_link(self.itor))
2229 __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;}
2230 __Pyx_GOTREF(__pyx_t_2);
2231 __Pyx_DECREF(((PyObject *)__pyx_v_link));
2232 __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_2);
2235 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":224
2236 * raise StopIteration
2238 * link.set_link(self.dag, ps_latlink_iter_link(self.itor)) # <<<<<<<<<<<<<<
2242 __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;}
2243 __Pyx_GOTREF(__pyx_t_2);
2244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2246 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":225
2248 * link.set_link(self.dag, ps_latlink_iter_link(self.itor))
2249 * return link # <<<<<<<<<<<<<<
2251 * cdef class Lattice:
2253 __Pyx_XDECREF(__pyx_r);
2254 __Pyx_INCREF(((PyObject *)__pyx_v_link));
2255 __pyx_r = ((PyObject *)__pyx_v_link);
2258 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2261 __Pyx_XDECREF(__pyx_t_2);
2262 __Pyx_AddTraceback("pocketsphinx.LatLinkIterator.__next__");
2265 __Pyx_DECREF((PyObject *)__pyx_v_link);
2266 __Pyx_XGIVEREF(__pyx_r);
2267 __Pyx_RefNannyFinishContext();
2271 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":254
2272 * @type end: LatNode
2274 * def __init__(self, ps=None, latfile=None, boxed=None): # <<<<<<<<<<<<<<
2279 static int __pyx_pf_12pocketsphinx_7Lattice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2280 static int __pyx_pf_12pocketsphinx_7Lattice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2281 PyObject *__pyx_v_ps = 0;
2282 PyObject *__pyx_v_latfile = 0;
2283 PyObject *__pyx_v_boxed = 0;
2286 PyObject *__pyx_t_2 = NULL;
2287 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ps,&__pyx_n_s__latfile,&__pyx_n_s__boxed,0};
2288 __Pyx_RefNannySetupContext("__init__");
2289 if (unlikely(__pyx_kwds)) {
2290 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2291 PyObject* values[3] = {0,0,0};
2292 values[0] = ((PyObject *)Py_None);
2293 values[1] = ((PyObject *)Py_None);
2294 values[2] = ((PyObject *)Py_None);
2295 switch (PyTuple_GET_SIZE(__pyx_args)) {
2296 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2297 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2298 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2300 default: goto __pyx_L5_argtuple_error;
2302 switch (PyTuple_GET_SIZE(__pyx_args)) {
2305 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ps);
2306 if (value) { values[0] = value; kw_args--; }
2310 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__latfile);
2311 if (value) { values[1] = value; kw_args--; }
2315 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__boxed);
2316 if (value) { values[2] = value; kw_args--; }
2319 if (unlikely(kw_args > 0)) {
2320 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;}
2322 __pyx_v_ps = values[0];
2323 __pyx_v_latfile = values[1];
2324 __pyx_v_boxed = values[2];
2326 __pyx_v_ps = ((PyObject *)Py_None);
2327 __pyx_v_latfile = ((PyObject *)Py_None);
2328 __pyx_v_boxed = ((PyObject *)Py_None);
2329 switch (PyTuple_GET_SIZE(__pyx_args)) {
2330 case 3: __pyx_v_boxed = PyTuple_GET_ITEM(__pyx_args, 2);
2331 case 2: __pyx_v_latfile = PyTuple_GET_ITEM(__pyx_args, 1);
2332 case 1: __pyx_v_ps = PyTuple_GET_ITEM(__pyx_args, 0);
2334 default: goto __pyx_L5_argtuple_error;
2337 goto __pyx_L4_argument_unpacking_done;
2338 __pyx_L5_argtuple_error:;
2339 __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;}
2341 __Pyx_AddTraceback("pocketsphinx.Lattice.__init__");
2342 __Pyx_RefNannyFinishContext();
2344 __pyx_L4_argument_unpacking_done:;
2346 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":255
2348 * def __init__(self, ps=None, latfile=None, boxed=None):
2349 * self.dag = NULL # <<<<<<<<<<<<<<
2351 * self.read_dag(ps, latfile)
2353 ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag = NULL;
2355 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":256
2356 * def __init__(self, ps=None, latfile=None, boxed=None):
2358 * if latfile: # <<<<<<<<<<<<<<
2359 * self.read_dag(ps, latfile)
2362 __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;}
2365 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":257
2368 * self.read_dag(ps, latfile) # <<<<<<<<<<<<<<
2370 * self.set_boxed(boxed)
2372 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;}
2373 __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;}
2374 __Pyx_GOTREF(__pyx_t_2);
2375 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2380 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":258
2382 * self.read_dag(ps, latfile)
2383 * if boxed: # <<<<<<<<<<<<<<
2384 * self.set_boxed(boxed)
2387 __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;}
2390 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":259
2391 * self.read_dag(ps, latfile)
2393 * self.set_boxed(boxed) # <<<<<<<<<<<<<<
2395 * cdef read_dag(Lattice self, Decoder ps, latfile):
2397 __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;}
2398 __Pyx_GOTREF(__pyx_t_2);
2399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2407 __Pyx_XDECREF(__pyx_t_2);
2408 __Pyx_AddTraceback("pocketsphinx.Lattice.__init__");
2411 __Pyx_RefNannyFinishContext();
2415 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":261
2416 * self.set_boxed(boxed)
2418 * cdef read_dag(Lattice self, Decoder ps, latfile): # <<<<<<<<<<<<<<
2420 * self.dag = ps_lattice_read(ps.ps, latfile)
2423 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) {
2424 PyObject *__pyx_r = NULL;
2427 PyObject *__pyx_t_3 = NULL;
2428 __Pyx_RefNannySetupContext("read_dag");
2430 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":262
2432 * cdef read_dag(Lattice self, Decoder ps, latfile):
2433 * if ps: # <<<<<<<<<<<<<<
2434 * self.dag = ps_lattice_read(ps.ps, latfile)
2437 __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;}
2440 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":263
2441 * cdef read_dag(Lattice self, Decoder ps, latfile):
2443 * self.dag = ps_lattice_read(ps.ps, latfile) # <<<<<<<<<<<<<<
2445 * self.dag = ps_lattice_read(NULL, latfile)
2447 __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;}
2448 __pyx_v_self->dag = ps_lattice_read(__pyx_v_ps->ps, __pyx_t_2);
2453 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":265
2454 * self.dag = ps_lattice_read(ps.ps, latfile)
2456 * self.dag = ps_lattice_read(NULL, latfile) # <<<<<<<<<<<<<<
2457 * self.n_frames = ps_lattice_n_frames(self.dag)
2458 * if self.dag == NULL:
2460 __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;}
2461 __pyx_v_self->dag = ps_lattice_read(NULL, __pyx_t_2);
2465 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":266
2467 * self.dag = ps_lattice_read(NULL, latfile)
2468 * self.n_frames = ps_lattice_n_frames(self.dag) # <<<<<<<<<<<<<<
2469 * if self.dag == NULL:
2470 * raise RuntimeError, "Failed to read lattice from %s" % latfile
2472 __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;}
2473 __Pyx_GOTREF(__pyx_t_3);
2474 __Pyx_GIVEREF(__pyx_t_3);
2475 __Pyx_GOTREF(__pyx_v_self->n_frames);
2476 __Pyx_DECREF(__pyx_v_self->n_frames);
2477 __pyx_v_self->n_frames = __pyx_t_3;
2480 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":267
2481 * self.dag = ps_lattice_read(NULL, latfile)
2482 * self.n_frames = ps_lattice_n_frames(self.dag)
2483 * if self.dag == NULL: # <<<<<<<<<<<<<<
2484 * raise RuntimeError, "Failed to read lattice from %s" % latfile
2487 __pyx_t_1 = (__pyx_v_self->dag == NULL);
2490 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":268
2491 * self.n_frames = ps_lattice_n_frames(self.dag)
2492 * if self.dag == NULL:
2493 * raise RuntimeError, "Failed to read lattice from %s" % latfile # <<<<<<<<<<<<<<
2495 * cdef set_dag(Lattice self, ps_lattice_t *dag):
2497 __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;}
2498 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2499 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), 0);
2500 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
2501 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2506 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2509 __Pyx_XDECREF(__pyx_t_3);
2510 __Pyx_AddTraceback("pocketsphinx.Lattice.read_dag");
2513 __Pyx_XGIVEREF(__pyx_r);
2514 __Pyx_RefNannyFinishContext();
2518 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":270
2519 * raise RuntimeError, "Failed to read lattice from %s" % latfile
2521 * cdef set_dag(Lattice self, ps_lattice_t *dag): # <<<<<<<<<<<<<<
2522 * ps_lattice_retain(dag)
2523 * ps_lattice_free(self.dag)
2526 static PyObject *__pyx_f_12pocketsphinx_7Lattice_set_dag(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, ps_lattice_t *__pyx_v_dag) {
2527 PyObject *__pyx_r = NULL;
2528 PyObject *__pyx_t_1 = NULL;
2529 __Pyx_RefNannySetupContext("set_dag");
2531 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":271
2533 * cdef set_dag(Lattice self, ps_lattice_t *dag):
2534 * ps_lattice_retain(dag) # <<<<<<<<<<<<<<
2535 * ps_lattice_free(self.dag)
2538 ps_lattice_retain(__pyx_v_dag);
2540 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":272
2541 * cdef set_dag(Lattice self, ps_lattice_t *dag):
2542 * ps_lattice_retain(dag)
2543 * ps_lattice_free(self.dag) # <<<<<<<<<<<<<<
2545 * self.n_frames = ps_lattice_n_frames(dag)
2547 ps_lattice_free(__pyx_v_self->dag);
2549 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":273
2550 * ps_lattice_retain(dag)
2551 * ps_lattice_free(self.dag)
2552 * self.dag = dag # <<<<<<<<<<<<<<
2553 * self.n_frames = ps_lattice_n_frames(dag)
2556 __pyx_v_self->dag = __pyx_v_dag;
2558 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":274
2559 * ps_lattice_free(self.dag)
2561 * self.n_frames = ps_lattice_n_frames(dag) # <<<<<<<<<<<<<<
2563 * cdef set_boxed(Lattice self, box):
2565 __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;}
2566 __Pyx_GOTREF(__pyx_t_1);
2567 __Pyx_GIVEREF(__pyx_t_1);
2568 __Pyx_GOTREF(__pyx_v_self->n_frames);
2569 __Pyx_DECREF(__pyx_v_self->n_frames);
2570 __pyx_v_self->n_frames = __pyx_t_1;
2573 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2576 __Pyx_XDECREF(__pyx_t_1);
2577 __Pyx_AddTraceback("pocketsphinx.Lattice.set_dag");
2580 __Pyx_XGIVEREF(__pyx_r);
2581 __Pyx_RefNannyFinishContext();
2585 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":276
2586 * self.n_frames = ps_lattice_n_frames(dag)
2588 * cdef set_boxed(Lattice self, box): # <<<<<<<<<<<<<<
2589 * cdef ps_lattice_t *dag
2590 * dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
2593 static PyObject *__pyx_f_12pocketsphinx_7Lattice_set_boxed(struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_self, PyObject *__pyx_v_box) {
2594 ps_lattice_t *__pyx_v_dag;
2595 PyObject *__pyx_r = NULL;
2596 PyObject *__pyx_t_1 = NULL;
2597 __Pyx_RefNannySetupContext("set_boxed");
2599 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":278
2600 * cdef set_boxed(Lattice self, box):
2601 * cdef ps_lattice_t *dag
2602 * dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed # <<<<<<<<<<<<<<
2603 * ps_lattice_retain(dag)
2604 * ps_lattice_free(self.dag)
2606 __pyx_v_dag = ((ps_lattice_t *)((PyGBoxed *)__pyx_v_box)->boxed);
2608 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":279
2609 * cdef ps_lattice_t *dag
2610 * dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
2611 * ps_lattice_retain(dag) # <<<<<<<<<<<<<<
2612 * ps_lattice_free(self.dag)
2615 ps_lattice_retain(__pyx_v_dag);
2617 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":280
2618 * dag = <ps_lattice_t *>(<PyGBoxed *>box).boxed
2619 * ps_lattice_retain(dag)
2620 * ps_lattice_free(self.dag) # <<<<<<<<<<<<<<
2622 * self.n_frames = ps_lattice_n_frames(self.dag)
2624 ps_lattice_free(__pyx_v_self->dag);
2626 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":281
2627 * ps_lattice_retain(dag)
2628 * ps_lattice_free(self.dag)
2629 * self.dag = dag # <<<<<<<<<<<<<<
2630 * self.n_frames = ps_lattice_n_frames(self.dag)
2633 __pyx_v_self->dag = __pyx_v_dag;
2635 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":282
2636 * ps_lattice_free(self.dag)
2638 * self.n_frames = ps_lattice_n_frames(self.dag) # <<<<<<<<<<<<<<
2640 * def __dealloc__(self):
2642 __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;}
2643 __Pyx_GOTREF(__pyx_t_1);
2644 __Pyx_GIVEREF(__pyx_t_1);
2645 __Pyx_GOTREF(__pyx_v_self->n_frames);
2646 __Pyx_DECREF(__pyx_v_self->n_frames);
2647 __pyx_v_self->n_frames = __pyx_t_1;
2650 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2653 __Pyx_XDECREF(__pyx_t_1);
2654 __Pyx_AddTraceback("pocketsphinx.Lattice.set_boxed");
2657 __Pyx_XGIVEREF(__pyx_r);
2658 __Pyx_RefNannyFinishContext();
2662 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":284
2663 * self.n_frames = ps_lattice_n_frames(self.dag)
2665 * def __dealloc__(self): # <<<<<<<<<<<<<<
2666 * ps_lattice_free(self.dag)
2670 static void __pyx_pf_12pocketsphinx_7Lattice___dealloc__(PyObject *__pyx_v_self); /*proto*/
2671 static void __pyx_pf_12pocketsphinx_7Lattice___dealloc__(PyObject *__pyx_v_self) {
2672 __Pyx_RefNannySetupContext("__dealloc__");
2674 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":285
2676 * def __dealloc__(self):
2677 * ps_lattice_free(self.dag) # <<<<<<<<<<<<<<
2679 * def bestpath(self, NGramModel lmset, float lwf, float ascale):
2681 ps_lattice_free(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);
2683 __Pyx_RefNannyFinishContext();
2686 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":287
2687 * ps_lattice_free(self.dag)
2689 * def bestpath(self, NGramModel lmset, float lwf, float ascale): # <<<<<<<<<<<<<<
2691 * Find the best path through the lattice, optionally using a
2694 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_bestpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2695 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 ";
2696 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_bestpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2697 struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lmset = 0;
2699 float __pyx_v_ascale;
2700 ps_latlink_t *__pyx_v_end;
2701 struct __pyx_obj_12pocketsphinx_LatLink *__pyx_v_link;
2702 PyObject *__pyx_r = NULL;
2703 PyObject *__pyx_t_1 = NULL;
2704 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lmset,&__pyx_n_s__lwf,&__pyx_n_s__ascale,0};
2705 __Pyx_RefNannySetupContext("bestpath");
2706 if (unlikely(__pyx_kwds)) {
2707 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2708 PyObject* values[3] = {0,0,0};
2709 switch (PyTuple_GET_SIZE(__pyx_args)) {
2710 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2711 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2712 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2714 default: goto __pyx_L5_argtuple_error;
2716 switch (PyTuple_GET_SIZE(__pyx_args)) {
2718 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lmset);
2719 if (likely(values[0])) kw_args--;
2720 else goto __pyx_L5_argtuple_error;
2722 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lwf);
2723 if (likely(values[1])) kw_args--;
2725 __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2728 values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascale);
2729 if (likely(values[2])) kw_args--;
2731 __Pyx_RaiseArgtupleInvalid("bestpath", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2734 if (unlikely(kw_args > 0)) {
2735 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;}
2737 __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)values[0]);
2738 __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;}
2739 __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;}
2740 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2741 goto __pyx_L5_argtuple_error;
2743 __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)PyTuple_GET_ITEM(__pyx_args, 0));
2744 __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;}
2745 __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;}
2747 goto __pyx_L4_argument_unpacking_done;
2748 __pyx_L5_argtuple_error:;
2749 __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;}
2751 __Pyx_AddTraceback("pocketsphinx.Lattice.bestpath");
2752 __Pyx_RefNannyFinishContext();
2754 __pyx_L4_argument_unpacking_done:;
2755 __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); __Pyx_INCREF(Py_None);
2756 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;}
2758 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":312
2759 * cdef ps_latlink_t *end
2761 * end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale) # <<<<<<<<<<<<<<
2763 * link.set_link(self.dag, end)
2765 __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);
2767 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":313
2769 * end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)
2770 * link = LatLink() # <<<<<<<<<<<<<<
2771 * link.set_link(self.dag, end)
2774 __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;}
2775 __Pyx_GOTREF(__pyx_t_1);
2776 __Pyx_DECREF(((PyObject *)__pyx_v_link));
2777 __pyx_v_link = ((struct __pyx_obj_12pocketsphinx_LatLink *)__pyx_t_1);
2780 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":314
2781 * end = ps_lattice_bestpath(self.dag, lmset.lm, lwf, ascale)
2783 * link.set_link(self.dag, end) # <<<<<<<<<<<<<<
2787 __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;}
2788 __Pyx_GOTREF(__pyx_t_1);
2789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2791 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":315
2793 * link.set_link(self.dag, end)
2794 * return link # <<<<<<<<<<<<<<
2796 * def posterior(self, NGramModel lmset, float ascale):
2798 __Pyx_XDECREF(__pyx_r);
2799 __Pyx_INCREF(((PyObject *)__pyx_v_link));
2800 __pyx_r = ((PyObject *)__pyx_v_link);
2803 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2806 __Pyx_XDECREF(__pyx_t_1);
2807 __Pyx_AddTraceback("pocketsphinx.Lattice.bestpath");
2810 __Pyx_DECREF((PyObject *)__pyx_v_link);
2811 __Pyx_XGIVEREF(__pyx_r);
2812 __Pyx_RefNannyFinishContext();
2816 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":317
2819 * def posterior(self, NGramModel lmset, float ascale): # <<<<<<<<<<<<<<
2821 * Calculate posterior probabilities of all links in a lattice.
2824 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_posterior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2825 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 ";
2826 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_posterior(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2827 struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lmset = 0;
2828 float __pyx_v_ascale;
2829 logmath_t *__pyx_v_lmath;
2830 PyObject *__pyx_r = NULL;
2831 PyObject *__pyx_t_1 = NULL;
2832 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lmset,&__pyx_n_s__ascale,0};
2833 __Pyx_RefNannySetupContext("posterior");
2834 if (unlikely(__pyx_kwds)) {
2835 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2836 PyObject* values[2] = {0,0};
2837 switch (PyTuple_GET_SIZE(__pyx_args)) {
2838 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2839 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2841 default: goto __pyx_L5_argtuple_error;
2843 switch (PyTuple_GET_SIZE(__pyx_args)) {
2845 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lmset);
2846 if (likely(values[0])) kw_args--;
2847 else goto __pyx_L5_argtuple_error;
2849 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascale);
2850 if (likely(values[1])) kw_args--;
2852 __Pyx_RaiseArgtupleInvalid("posterior", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2855 if (unlikely(kw_args > 0)) {
2856 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;}
2858 __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)values[0]);
2859 __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;}
2860 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2861 goto __pyx_L5_argtuple_error;
2863 __pyx_v_lmset = ((struct __pyx_obj_10sphinxbase_NGramModel *)PyTuple_GET_ITEM(__pyx_args, 0));
2864 __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;}
2866 goto __pyx_L4_argument_unpacking_done;
2867 __pyx_L5_argtuple_error:;
2868 __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;}
2870 __Pyx_AddTraceback("pocketsphinx.Lattice.posterior");
2871 __Pyx_RefNannyFinishContext();
2873 __pyx_L4_argument_unpacking_done:;
2874 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;}
2876 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":334
2878 * cdef logmath_t *lmath
2879 * lmath = ps_lattice_get_logmath(self.dag) # <<<<<<<<<<<<<<
2880 * return sb.logmath_log_to_ln(lmath,
2881 * ps_lattice_posterior(self.dag, lmset.lm, ascale))
2883 __pyx_v_lmath = ps_lattice_get_logmath(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);
2885 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":335
2886 * cdef logmath_t *lmath
2887 * lmath = ps_lattice_get_logmath(self.dag)
2888 * return sb.logmath_log_to_ln(lmath, # <<<<<<<<<<<<<<
2889 * ps_lattice_posterior(self.dag, lmset.lm, ascale))
2892 __Pyx_XDECREF(__pyx_r);
2894 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":336
2895 * lmath = ps_lattice_get_logmath(self.dag)
2896 * return sb.logmath_log_to_ln(lmath,
2897 * ps_lattice_posterior(self.dag, lmset.lm, ascale)) # <<<<<<<<<<<<<<
2899 * def nodes(self, start=0, end=-1):
2901 __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;}
2902 __Pyx_GOTREF(__pyx_t_1);
2903 __pyx_r = __pyx_t_1;
2907 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2910 __Pyx_XDECREF(__pyx_t_1);
2911 __Pyx_AddTraceback("pocketsphinx.Lattice.posterior");
2914 __Pyx_XGIVEREF(__pyx_r);
2915 __Pyx_RefNannyFinishContext();
2919 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":338
2920 * ps_lattice_posterior(self.dag, lmset.lm, ascale))
2922 * def nodes(self, start=0, end=-1): # <<<<<<<<<<<<<<
2924 * Get an iterator over all nodes in the lattice.
2927 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2928 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 ";
2929 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2930 PyObject *__pyx_v_start = 0;
2931 PyObject *__pyx_v_end = 0;
2932 struct __pyx_obj_12pocketsphinx_LatNodeIterator *__pyx_v_itor;
2933 PyObject *__pyx_r = NULL;
2934 PyObject *__pyx_t_1 = NULL;
2936 PyObject *__pyx_t_3 = NULL;
2937 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0};
2938 __Pyx_RefNannySetupContext("nodes");
2939 if (unlikely(__pyx_kwds)) {
2940 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2941 PyObject* values[2] = {0,0};
2942 values[0] = ((PyObject *)__pyx_int_0);
2943 values[1] = ((PyObject *)__pyx_int_neg_1);
2944 switch (PyTuple_GET_SIZE(__pyx_args)) {
2945 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2946 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2948 default: goto __pyx_L5_argtuple_error;
2950 switch (PyTuple_GET_SIZE(__pyx_args)) {
2953 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
2954 if (value) { values[0] = value; kw_args--; }
2958 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
2959 if (value) { values[1] = value; kw_args--; }
2962 if (unlikely(kw_args > 0)) {
2963 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;}
2965 __pyx_v_start = values[0];
2966 __pyx_v_end = values[1];
2968 __pyx_v_start = ((PyObject *)__pyx_int_0);
2969 __pyx_v_end = ((PyObject *)__pyx_int_neg_1);
2970 switch (PyTuple_GET_SIZE(__pyx_args)) {
2971 case 2: __pyx_v_end = PyTuple_GET_ITEM(__pyx_args, 1);
2972 case 1: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
2974 default: goto __pyx_L5_argtuple_error;
2977 goto __pyx_L4_argument_unpacking_done;
2978 __pyx_L5_argtuple_error:;
2979 __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;}
2981 __Pyx_AddTraceback("pocketsphinx.Lattice.nodes");
2982 __Pyx_RefNannyFinishContext();
2984 __pyx_L4_argument_unpacking_done:;
2985 __Pyx_INCREF(__pyx_v_end);
2986 __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)Py_None); __Pyx_INCREF(Py_None);
2988 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":351
2989 * cdef LatNodeIterator itor
2991 * if end == -1: # <<<<<<<<<<<<<<
2992 * end = ps_lattice_n_frames(self.dag)
2993 * itor = LatNodeIterator(start, end)
2995 __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;}
2996 __Pyx_GOTREF(__pyx_t_1);
2997 __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;}
2998 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3001 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":352
3004 * end = ps_lattice_n_frames(self.dag) # <<<<<<<<<<<<<<
3005 * itor = LatNodeIterator(start, end)
3006 * itor.dag = self.dag
3008 __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;}
3009 __Pyx_GOTREF(__pyx_t_1);
3010 __Pyx_DECREF(__pyx_v_end);
3011 __pyx_v_end = __pyx_t_1;
3017 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":353
3019 * end = ps_lattice_n_frames(self.dag)
3020 * itor = LatNodeIterator(start, end) # <<<<<<<<<<<<<<
3021 * itor.dag = self.dag
3022 * itor.itor = ps_latnode_iter(self.dag)
3024 __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;}
3025 __Pyx_GOTREF(__pyx_t_1);
3026 __Pyx_INCREF(__pyx_v_start);
3027 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start);
3028 __Pyx_GIVEREF(__pyx_v_start);
3029 __Pyx_INCREF(__pyx_v_end);
3030 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end);
3031 __Pyx_GIVEREF(__pyx_v_end);
3032 __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;}
3033 __Pyx_GOTREF(__pyx_t_3);
3034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3035 __Pyx_DECREF(((PyObject *)__pyx_v_itor));
3036 __pyx_v_itor = ((struct __pyx_obj_12pocketsphinx_LatNodeIterator *)__pyx_t_3);
3039 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":354
3040 * end = ps_lattice_n_frames(self.dag)
3041 * itor = LatNodeIterator(start, end)
3042 * itor.dag = self.dag # <<<<<<<<<<<<<<
3043 * itor.itor = ps_latnode_iter(self.dag)
3046 __pyx_v_itor->dag = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag;
3048 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":355
3049 * itor = LatNodeIterator(start, end)
3050 * itor.dag = self.dag
3051 * itor.itor = ps_latnode_iter(self.dag) # <<<<<<<<<<<<<<
3055 __pyx_v_itor->itor = ps_latnode_iter(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag);
3057 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":356
3058 * itor.dag = self.dag
3059 * itor.itor = ps_latnode_iter(self.dag)
3060 * return itor # <<<<<<<<<<<<<<
3062 * def write(self, outfile):
3064 __Pyx_XDECREF(__pyx_r);
3065 __Pyx_INCREF(((PyObject *)__pyx_v_itor));
3066 __pyx_r = ((PyObject *)__pyx_v_itor);
3069 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3072 __Pyx_XDECREF(__pyx_t_1);
3073 __Pyx_XDECREF(__pyx_t_3);
3074 __Pyx_AddTraceback("pocketsphinx.Lattice.nodes");
3077 __Pyx_DECREF((PyObject *)__pyx_v_itor);
3078 __Pyx_DECREF(__pyx_v_end);
3079 __Pyx_XGIVEREF(__pyx_r);
3080 __Pyx_RefNannyFinishContext();
3084 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":358
3087 * def write(self, outfile): # <<<<<<<<<<<<<<
3089 * Write the lattice to an output file.
3092 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_write(PyObject *__pyx_v_self, PyObject *__pyx_v_outfile); /*proto*/
3093 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 ";
3094 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_write(PyObject *__pyx_v_self, PyObject *__pyx_v_outfile) {
3096 PyObject *__pyx_r = NULL;
3099 PyObject *__pyx_t_3 = NULL;
3100 __Pyx_RefNannySetupContext("write");
3102 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":367
3105 * rv = ps_lattice_write(self.dag, outfile) # <<<<<<<<<<<<<<
3107 * raise RuntimeError, "Failed to write lattice to %s" % outfile
3109 __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;}
3110 __pyx_v_rv = ps_lattice_write(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->dag, __pyx_t_1);
3112 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":368
3114 * rv = ps_lattice_write(self.dag, outfile)
3115 * if rv < 0: # <<<<<<<<<<<<<<
3116 * raise RuntimeError, "Failed to write lattice to %s" % outfile
3119 __pyx_t_2 = (__pyx_v_rv < 0);
3122 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":369
3123 * rv = ps_lattice_write(self.dag, outfile)
3125 * raise RuntimeError, "Failed to write lattice to %s" % outfile # <<<<<<<<<<<<<<
3127 * cdef class Decoder:
3129 __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;}
3130 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3131 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), 0);
3132 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
3133 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3138 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3141 __Pyx_XDECREF(__pyx_t_3);
3142 __Pyx_AddTraceback("pocketsphinx.Lattice.write");
3145 __Pyx_XGIVEREF(__pyx_r);
3146 __Pyx_RefNannyFinishContext();
3150 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":399
3153 * def __init__(self, **kwargs): # <<<<<<<<<<<<<<
3154 * cdef cmd_ln_t *config
3158 static int __pyx_pf_12pocketsphinx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3159 static int __pyx_pf_12pocketsphinx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3160 PyObject *__pyx_v_kwargs = 0;
3161 cmd_ln_t *__pyx_v_config;
3163 PyObject *__pyx_v_k;
3164 PyObject *__pyx_v_v;
3167 PyObject *__pyx_t_2 = NULL;
3168 PyObject *__pyx_t_3 = NULL;
3169 Py_ssize_t __pyx_t_4;
3172 PyObject *__pyx_t_7 = NULL;
3174 __Pyx_RefNannySetupContext("__init__");
3175 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
3176 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
3177 if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
3178 __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
3179 if (unlikely(!__pyx_v_kwargs)) return -1;
3180 __Pyx_GOTREF(__pyx_v_kwargs);
3181 __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
3182 __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
3184 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":404
3186 * # Construct from an existing GObject pointer if given
3187 * if 'boxed' in kwargs: # <<<<<<<<<<<<<<
3189 * self.set_boxed(kwargs['boxed'])
3191 if (unlikely(((PyObject *)__pyx_v_kwargs) == Py_None)) {
3192 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3194 __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;}
3198 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":405
3199 * # Construct from an existing GObject pointer if given
3200 * if 'boxed' in kwargs:
3201 * self.argc = 0 # <<<<<<<<<<<<<<
3202 * self.set_boxed(kwargs['boxed'])
3205 ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = 0;
3207 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":406
3208 * if 'boxed' in kwargs:
3210 * self.set_boxed(kwargs['boxed']) # <<<<<<<<<<<<<<
3214 __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;}
3215 __Pyx_GOTREF(__pyx_t_2);
3216 __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;}
3217 __Pyx_GOTREF(__pyx_t_3);
3218 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3219 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3221 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":407
3223 * self.set_boxed(kwargs['boxed'])
3224 * return # <<<<<<<<<<<<<<
3226 * # A much more concise version of what pocketsphinx_parse_argdict used to do
3234 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":410
3236 * # A much more concise version of what pocketsphinx_parse_argdict used to do
3237 * self.argc = len(kwargs) * 2 # <<<<<<<<<<<<<<
3238 * self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
3241 if (unlikely(__pyx_v_kwargs == Py_None)) {
3242 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;}
3244 __pyx_t_4 = PyDict_Size(((PyObject *)__pyx_v_kwargs));
3245 ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = (__pyx_t_4 * 2);
3247 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":411
3248 * # A much more concise version of what pocketsphinx_parse_argdict used to do
3249 * self.argc = len(kwargs) * 2
3250 * self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *)) # <<<<<<<<<<<<<<
3252 * for k, v in kwargs.iteritems():
3254 ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv = ((char **)ckd_calloc(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc, (sizeof(char *))));
3256 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":412
3257 * self.argc = len(kwargs) * 2
3258 * self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
3259 * i = 0 # <<<<<<<<<<<<<<
3260 * for k, v in kwargs.iteritems():
3265 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":413
3266 * self.argv = <char **>sb.ckd_calloc(self.argc, sizeof(char *))
3268 * for k, v in kwargs.iteritems(): # <<<<<<<<<<<<<<
3272 __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
3273 __Pyx_XDECREF(__pyx_t_3);
3274 __pyx_t_3 = ((PyObject *)__pyx_v_kwargs);
3277 if (!PyDict_Next(__pyx_t_3, (&__pyx_t_4), ((PyObject **)(&__pyx_t_5)), ((PyObject **)(&__pyx_t_6)))) break;
3278 __Pyx_INCREF(((PyObject *)__pyx_t_5));
3279 __Pyx_DECREF(__pyx_v_k);
3280 __pyx_v_k = ((PyObject *)__pyx_t_5);
3281 __Pyx_INCREF(((PyObject *)__pyx_t_6));
3282 __Pyx_DECREF(__pyx_v_v);
3283 __pyx_v_v = ((PyObject *)__pyx_t_6);
3285 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":414
3287 * for k, v in kwargs.iteritems():
3288 * if k[0] != '-': # <<<<<<<<<<<<<<
3290 * self.argv[i] = sb.ckd_salloc(k)
3292 __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;}
3293 __Pyx_GOTREF(__pyx_t_2);
3294 __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;}
3295 __Pyx_GOTREF(__pyx_t_7);
3296 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3297 __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;}
3298 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3301 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":415
3302 * for k, v in kwargs.iteritems():
3304 * k = '-' + k # <<<<<<<<<<<<<<
3305 * self.argv[i] = sb.ckd_salloc(k)
3306 * self.argv[i+1] = sb.ckd_salloc(v)
3308 __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;}
3309 __Pyx_GOTREF(__pyx_t_7);
3310 __Pyx_DECREF(__pyx_v_k);
3311 __pyx_v_k = __pyx_t_7;
3317 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":416
3320 * self.argv[i] = sb.ckd_salloc(k) # <<<<<<<<<<<<<<
3321 * self.argv[i+1] = sb.ckd_salloc(v)
3324 __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;}
3325 (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[__pyx_v_i]) = ckd_salloc(__pyx_t_8);
3327 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":417
3329 * self.argv[i] = sb.ckd_salloc(k)
3330 * self.argv[i+1] = sb.ckd_salloc(v) # <<<<<<<<<<<<<<
3332 * config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3334 __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;}
3335 (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[(__pyx_v_i + 1)]) = ckd_salloc(__pyx_t_8);
3337 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":418
3338 * self.argv[i] = sb.ckd_salloc(k)
3339 * self.argv[i+1] = sb.ckd_salloc(v)
3340 * i = i + 2 # <<<<<<<<<<<<<<
3341 * config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3342 * if config == NULL:
3344 __pyx_v_i = (__pyx_v_i + 2);
3346 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3348 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":419
3349 * self.argv[i+1] = sb.ckd_salloc(v)
3351 * config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0) # <<<<<<<<<<<<<<
3352 * if config == NULL:
3353 * raise RuntimeError, "Failed to parse argument list"
3355 __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);
3357 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":420
3359 * config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3360 * if config == NULL: # <<<<<<<<<<<<<<
3361 * raise RuntimeError, "Failed to parse argument list"
3362 * self.ps = ps_init(config)
3364 __pyx_t_1 = (__pyx_v_config == NULL);
3367 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":421
3368 * config = sb.cmd_ln_parse_r(NULL, ps_args(), self.argc, self.argv, 0)
3369 * if config == NULL:
3370 * raise RuntimeError, "Failed to parse argument list" # <<<<<<<<<<<<<<
3371 * self.ps = ps_init(config)
3372 * if self.ps == NULL:
3374 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_4), 0);
3375 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3380 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":422
3381 * if config == NULL:
3382 * raise RuntimeError, "Failed to parse argument list"
3383 * self.ps = ps_init(config) # <<<<<<<<<<<<<<
3384 * if self.ps == NULL:
3385 * raise RuntimeError, "Failed to initialize PocketSphinx"
3387 ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps = ps_init(__pyx_v_config);
3389 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":423
3390 * raise RuntimeError, "Failed to parse argument list"
3391 * self.ps = ps_init(config)
3392 * if self.ps == NULL: # <<<<<<<<<<<<<<
3393 * raise RuntimeError, "Failed to initialize PocketSphinx"
3396 __pyx_t_1 = (((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps == NULL);
3399 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":424
3400 * self.ps = ps_init(config)
3401 * if self.ps == NULL:
3402 * raise RuntimeError, "Failed to initialize PocketSphinx" # <<<<<<<<<<<<<<
3404 * cdef set_boxed(Decoder self, box):
3406 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_5), 0);
3407 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3415 __Pyx_XDECREF(__pyx_t_2);
3416 __Pyx_XDECREF(__pyx_t_3);
3417 __Pyx_XDECREF(__pyx_t_7);
3418 __Pyx_AddTraceback("pocketsphinx.Decoder.__init__");
3421 __Pyx_DECREF(__pyx_v_kwargs);
3422 __Pyx_DECREF(__pyx_v_k);
3423 __Pyx_DECREF(__pyx_v_v);
3424 __Pyx_RefNannyFinishContext();
3428 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":426
3429 * raise RuntimeError, "Failed to initialize PocketSphinx"
3431 * cdef set_boxed(Decoder self, box): # <<<<<<<<<<<<<<
3432 * cdef ps_decoder_t *ps
3433 * ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
3436 static PyObject *__pyx_f_12pocketsphinx_7Decoder_set_boxed(struct __pyx_obj_12pocketsphinx_Decoder *__pyx_v_self, PyObject *__pyx_v_box) {
3437 ps_decoder_t *__pyx_v_ps;
3438 PyObject *__pyx_r = NULL;
3439 __Pyx_RefNannySetupContext("set_boxed");
3441 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":428
3442 * cdef set_boxed(Decoder self, box):
3443 * cdef ps_decoder_t *ps
3444 * ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed # <<<<<<<<<<<<<<
3448 __pyx_v_ps = ((ps_decoder_t *)((PyGBoxed *)__pyx_v_box)->boxed);
3450 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":429
3451 * cdef ps_decoder_t *ps
3452 * ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
3453 * ps_retain(ps) # <<<<<<<<<<<<<<
3457 ps_retain(__pyx_v_ps);
3459 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":430
3460 * ps = <ps_decoder_t *>(<PyGBoxed *>box).boxed
3462 * ps_free(self.ps) # <<<<<<<<<<<<<<
3466 ps_free(__pyx_v_self->ps);
3468 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":431
3471 * self.ps = ps # <<<<<<<<<<<<<<
3473 * def __dealloc__(self):
3475 __pyx_v_self->ps = __pyx_v_ps;
3477 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3478 __Pyx_XGIVEREF(__pyx_r);
3479 __Pyx_RefNannyFinishContext();
3483 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":433
3486 * def __dealloc__(self): # <<<<<<<<<<<<<<
3488 * for i from 0 <= i < self.argc:
3491 static void __pyx_pf_12pocketsphinx_7Decoder___dealloc__(PyObject *__pyx_v_self); /*proto*/
3492 static void __pyx_pf_12pocketsphinx_7Decoder___dealloc__(PyObject *__pyx_v_self) {
3495 __Pyx_RefNannySetupContext("__dealloc__");
3497 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":434
3499 * def __dealloc__(self):
3500 * ps_free(self.ps) # <<<<<<<<<<<<<<
3501 * for i from 0 <= i < self.argc:
3502 * sb.ckd_free(self.argv[i])
3504 ps_free(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
3506 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":435
3507 * def __dealloc__(self):
3509 * for i from 0 <= i < self.argc: # <<<<<<<<<<<<<<
3510 * sb.ckd_free(self.argv[i])
3511 * sb.ckd_free(self.argv)
3513 __pyx_t_1 = ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc;
3514 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
3516 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":436
3518 * for i from 0 <= i < self.argc:
3519 * sb.ckd_free(self.argv[i]) # <<<<<<<<<<<<<<
3520 * sb.ckd_free(self.argv)
3523 ckd_free((((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv[__pyx_v_i]));
3526 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":437
3527 * for i from 0 <= i < self.argc:
3528 * sb.ckd_free(self.argv[i])
3529 * sb.ckd_free(self.argv) # <<<<<<<<<<<<<<
3533 ckd_free(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv);
3535 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":438
3536 * sb.ckd_free(self.argv[i])
3537 * sb.ckd_free(self.argv)
3538 * self.argv = NULL # <<<<<<<<<<<<<<
3542 ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argv = NULL;
3544 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":439
3545 * sb.ckd_free(self.argv)
3547 * self.argc = 0 # <<<<<<<<<<<<<<
3549 * def decode_raw(self, fh, uttid=None, maxsamps=-1):
3551 ((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->argc = 0;
3553 __Pyx_RefNannyFinishContext();
3556 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":441
3559 * def decode_raw(self, fh, uttid=None, maxsamps=-1): # <<<<<<<<<<<<<<
3561 * Decode raw audio from a file.
3564 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3565 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 ";
3566 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3567 PyObject *__pyx_v_fh = 0;
3568 PyObject *__pyx_v_uttid = 0;
3569 PyObject *__pyx_v_maxsamps = 0;
3571 char *__pyx_v_cuttid;
3572 PyObject *__pyx_r = NULL;
3573 PyObject *__pyx_t_1 = NULL;
3577 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fh,&__pyx_n_s__uttid,&__pyx_n_s__maxsamps,0};
3578 __Pyx_RefNannySetupContext("decode_raw");
3579 if (unlikely(__pyx_kwds)) {
3580 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3581 PyObject* values[3] = {0,0,0};
3582 values[1] = ((PyObject *)Py_None);
3583 values[2] = ((PyObject *)__pyx_int_neg_1);
3584 switch (PyTuple_GET_SIZE(__pyx_args)) {
3585 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3586 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3587 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3589 default: goto __pyx_L5_argtuple_error;
3591 switch (PyTuple_GET_SIZE(__pyx_args)) {
3593 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fh);
3594 if (likely(values[0])) kw_args--;
3595 else goto __pyx_L5_argtuple_error;
3598 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
3599 if (value) { values[1] = value; kw_args--; }
3603 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxsamps);
3604 if (value) { values[2] = value; kw_args--; }
3607 if (unlikely(kw_args > 0)) {
3608 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;}
3610 __pyx_v_fh = values[0];
3611 __pyx_v_uttid = values[1];
3612 __pyx_v_maxsamps = values[2];
3614 __pyx_v_uttid = ((PyObject *)Py_None);
3615 __pyx_v_maxsamps = ((PyObject *)__pyx_int_neg_1);
3616 switch (PyTuple_GET_SIZE(__pyx_args)) {
3617 case 3: __pyx_v_maxsamps = PyTuple_GET_ITEM(__pyx_args, 2);
3618 case 2: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 1);
3619 case 1: __pyx_v_fh = PyTuple_GET_ITEM(__pyx_args, 0);
3621 default: goto __pyx_L5_argtuple_error;
3624 goto __pyx_L4_argument_unpacking_done;
3625 __pyx_L5_argtuple_error:;
3626 __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;}
3628 __Pyx_AddTraceback("pocketsphinx.Decoder.decode_raw");
3629 __Pyx_RefNannyFinishContext();
3631 __pyx_L4_argument_unpacking_done:;
3633 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":457
3636 * cfh = PyFile_AsFile(fh) # <<<<<<<<<<<<<<
3640 __pyx_v_cfh = PyFile_AsFile(__pyx_v_fh);
3642 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":458
3644 * cfh = PyFile_AsFile(fh)
3645 * if uttid == None: # <<<<<<<<<<<<<<
3649 __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;}
3650 __Pyx_GOTREF(__pyx_t_1);
3651 __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;}
3652 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3655 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":459
3656 * cfh = PyFile_AsFile(fh)
3658 * cuttid = NULL # <<<<<<<<<<<<<<
3662 __pyx_v_cuttid = NULL;
3667 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":461
3670 * cuttid = uttid # <<<<<<<<<<<<<<
3671 * return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)
3674 __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;}
3675 __pyx_v_cuttid = __pyx_t_3;
3679 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":462
3682 * return ps_decode_raw(self.ps, cfh, cuttid, maxsamps) # <<<<<<<<<<<<<<
3684 * def decode_senscr(self, fh, uttid=None):
3686 __Pyx_XDECREF(__pyx_r);
3687 __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;}
3688 __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;}
3689 __Pyx_GOTREF(__pyx_t_1);
3690 __pyx_r = __pyx_t_1;
3694 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3697 __Pyx_XDECREF(__pyx_t_1);
3698 __Pyx_AddTraceback("pocketsphinx.Decoder.decode_raw");
3701 __Pyx_XGIVEREF(__pyx_r);
3702 __Pyx_RefNannyFinishContext();
3706 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":464
3707 * return ps_decode_raw(self.ps, cfh, cuttid, maxsamps)
3709 * def decode_senscr(self, fh, uttid=None): # <<<<<<<<<<<<<<
3711 * Decode senone scores from a file.
3714 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_senscr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3715 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 ";
3716 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_decode_senscr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3717 PyObject *__pyx_v_fh = 0;
3718 PyObject *__pyx_v_uttid = 0;
3720 char *__pyx_v_cuttid;
3721 PyObject *__pyx_r = NULL;
3722 PyObject *__pyx_t_1 = NULL;
3725 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fh,&__pyx_n_s__uttid,0};
3726 __Pyx_RefNannySetupContext("decode_senscr");
3727 if (unlikely(__pyx_kwds)) {
3728 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3729 PyObject* values[2] = {0,0};
3730 values[1] = ((PyObject *)Py_None);
3731 switch (PyTuple_GET_SIZE(__pyx_args)) {
3732 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3733 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3735 default: goto __pyx_L5_argtuple_error;
3737 switch (PyTuple_GET_SIZE(__pyx_args)) {
3739 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fh);
3740 if (likely(values[0])) kw_args--;
3741 else goto __pyx_L5_argtuple_error;
3744 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
3745 if (value) { values[1] = value; kw_args--; }
3748 if (unlikely(kw_args > 0)) {
3749 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;}
3751 __pyx_v_fh = values[0];
3752 __pyx_v_uttid = values[1];
3754 __pyx_v_uttid = ((PyObject *)Py_None);
3755 switch (PyTuple_GET_SIZE(__pyx_args)) {
3756 case 2: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 1);
3757 case 1: __pyx_v_fh = PyTuple_GET_ITEM(__pyx_args, 0);
3759 default: goto __pyx_L5_argtuple_error;
3762 goto __pyx_L4_argument_unpacking_done;
3763 __pyx_L5_argtuple_error:;
3764 __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;}
3766 __Pyx_AddTraceback("pocketsphinx.Decoder.decode_senscr");
3767 __Pyx_RefNannyFinishContext();
3769 __pyx_L4_argument_unpacking_done:;
3771 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":476
3774 * cfh = PyFile_AsFile(fh) # <<<<<<<<<<<<<<
3778 __pyx_v_cfh = PyFile_AsFile(__pyx_v_fh);
3780 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":477
3782 * cfh = PyFile_AsFile(fh)
3783 * if uttid == None: # <<<<<<<<<<<<<<
3787 __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;}
3788 __Pyx_GOTREF(__pyx_t_1);
3789 __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;}
3790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3793 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":478
3794 * cfh = PyFile_AsFile(fh)
3796 * cuttid = NULL # <<<<<<<<<<<<<<
3800 __pyx_v_cuttid = NULL;
3805 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":480
3808 * cuttid = uttid # <<<<<<<<<<<<<<
3809 * return ps_decode_senscr(self.ps, cfh, cuttid)
3812 __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;}
3813 __pyx_v_cuttid = __pyx_t_3;
3817 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":481
3820 * return ps_decode_senscr(self.ps, cfh, cuttid) # <<<<<<<<<<<<<<
3822 * def start_utt(self, uttid=None):
3824 __Pyx_XDECREF(__pyx_r);
3825 __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;}
3826 __Pyx_GOTREF(__pyx_t_1);
3827 __pyx_r = __pyx_t_1;
3831 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3834 __Pyx_XDECREF(__pyx_t_1);
3835 __Pyx_AddTraceback("pocketsphinx.Decoder.decode_senscr");
3838 __Pyx_XGIVEREF(__pyx_r);
3839 __Pyx_RefNannyFinishContext();
3843 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":483
3844 * return ps_decode_senscr(self.ps, cfh, cuttid)
3846 * def start_utt(self, uttid=None): # <<<<<<<<<<<<<<
3848 * Prepare the decoder to recognize an utterance.
3851 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_start_utt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3852 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 ";
3853 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_start_utt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3854 PyObject *__pyx_v_uttid = 0;
3855 char *__pyx_v_cuttid;
3856 PyObject *__pyx_r = NULL;
3857 PyObject *__pyx_t_1 = NULL;
3860 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__uttid,0};
3861 __Pyx_RefNannySetupContext("start_utt");
3862 if (unlikely(__pyx_kwds)) {
3863 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3864 PyObject* values[1] = {0};
3865 values[0] = ((PyObject *)Py_None);
3866 switch (PyTuple_GET_SIZE(__pyx_args)) {
3867 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3869 default: goto __pyx_L5_argtuple_error;
3871 switch (PyTuple_GET_SIZE(__pyx_args)) {
3874 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uttid);
3875 if (value) { values[0] = value; kw_args--; }
3878 if (unlikely(kw_args > 0)) {
3879 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;}
3881 __pyx_v_uttid = values[0];
3883 __pyx_v_uttid = ((PyObject *)Py_None);
3884 switch (PyTuple_GET_SIZE(__pyx_args)) {
3885 case 1: __pyx_v_uttid = PyTuple_GET_ITEM(__pyx_args, 0);
3887 default: goto __pyx_L5_argtuple_error;
3890 goto __pyx_L4_argument_unpacking_done;
3891 __pyx_L5_argtuple_error:;
3892 __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;}
3894 __Pyx_AddTraceback("pocketsphinx.Decoder.start_utt");
3895 __Pyx_RefNannyFinishContext();
3897 __pyx_L4_argument_unpacking_done:;
3899 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":492
3902 * if uttid == None: # <<<<<<<<<<<<<<
3906 __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;}
3907 __Pyx_GOTREF(__pyx_t_1);
3908 __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;}
3909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3912 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":493
3915 * cuttid = NULL # <<<<<<<<<<<<<<
3919 __pyx_v_cuttid = NULL;
3924 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":495
3927 * cuttid = uttid # <<<<<<<<<<<<<<
3928 * if ps_start_utt(self.ps, cuttid) < 0:
3929 * raise RuntimeError, "Failed to start utterance processing"
3931 __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;}
3932 __pyx_v_cuttid = __pyx_t_3;
3936 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":496
3939 * if ps_start_utt(self.ps, cuttid) < 0: # <<<<<<<<<<<<<<
3940 * raise RuntimeError, "Failed to start utterance processing"
3943 __pyx_t_2 = (ps_start_utt(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, __pyx_v_cuttid) < 0);
3946 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":497
3948 * if ps_start_utt(self.ps, cuttid) < 0:
3949 * raise RuntimeError, "Failed to start utterance processing" # <<<<<<<<<<<<<<
3951 * def process_raw(self, data, no_search=False, full_utt=False):
3953 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_6), 0);
3954 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3959 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3962 __Pyx_XDECREF(__pyx_t_1);
3963 __Pyx_AddTraceback("pocketsphinx.Decoder.start_utt");
3966 __Pyx_XGIVEREF(__pyx_r);
3967 __Pyx_RefNannyFinishContext();
3971 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":499
3972 * raise RuntimeError, "Failed to start utterance processing"
3974 * def process_raw(self, data, no_search=False, full_utt=False): # <<<<<<<<<<<<<<
3976 * Process (decode) some audio data.
3979 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_process_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3980 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 ";
3981 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_process_raw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3982 PyObject *__pyx_v_data = 0;
3983 PyObject *__pyx_v_no_search = 0;
3984 PyObject *__pyx_v_full_utt = 0;
3985 Py_ssize_t __pyx_v_len;
3986 char *__pyx_v_strdata;
3987 int16 * __pyx_v_cdata;
3988 PyObject *__pyx_r = NULL;
3992 PyObject *__pyx_t_4 = NULL;
3993 PyObject *__pyx_t_5 = NULL;
3994 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__no_search,&__pyx_n_s__full_utt,0};
3995 __Pyx_RefNannySetupContext("process_raw");
3996 if (unlikely(__pyx_kwds)) {
3997 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3998 PyObject* values[3] = {0,0,0};
3999 values[1] = __pyx_k_7;
4000 values[2] = __pyx_k_8;
4001 switch (PyTuple_GET_SIZE(__pyx_args)) {
4002 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4003 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4004 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4006 default: goto __pyx_L5_argtuple_error;
4008 switch (PyTuple_GET_SIZE(__pyx_args)) {
4010 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
4011 if (likely(values[0])) kw_args--;
4012 else goto __pyx_L5_argtuple_error;
4015 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__no_search);
4016 if (value) { values[1] = value; kw_args--; }
4020 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__full_utt);
4021 if (value) { values[2] = value; kw_args--; }
4024 if (unlikely(kw_args > 0)) {
4025 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;}
4027 __pyx_v_data = values[0];
4028 __pyx_v_no_search = values[1];
4029 __pyx_v_full_utt = values[2];
4031 __pyx_v_no_search = __pyx_k_7;
4032 __pyx_v_full_utt = __pyx_k_8;
4033 switch (PyTuple_GET_SIZE(__pyx_args)) {
4034 case 3: __pyx_v_full_utt = PyTuple_GET_ITEM(__pyx_args, 2);
4035 case 2: __pyx_v_no_search = PyTuple_GET_ITEM(__pyx_args, 1);
4036 case 1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
4038 default: goto __pyx_L5_argtuple_error;
4041 goto __pyx_L4_argument_unpacking_done;
4042 __pyx_L5_argtuple_error:;
4043 __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;}
4045 __Pyx_AddTraceback("pocketsphinx.Decoder.process_raw");
4046 __Pyx_RefNannyFinishContext();
4048 __pyx_L4_argument_unpacking_done:;
4050 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":520
4051 * cdef raw_data_ptr cdata
4053 * PyString_AsStringAndSize(data, &strdata, &len) # <<<<<<<<<<<<<<
4055 * if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
4057 __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;}
4059 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":521
4061 * PyString_AsStringAndSize(data, &strdata, &len)
4062 * cdata = strdata # <<<<<<<<<<<<<<
4063 * if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
4064 * raise RuntimeError, "Failed to process %d samples of audio data" % len
4066 __pyx_v_cdata = __pyx_v_strdata;
4068 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":522
4069 * PyString_AsStringAndSize(data, &strdata, &len)
4071 * if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0: # <<<<<<<<<<<<<<
4072 * raise RuntimeError, "Failed to process %d samples of audio data" % len
4075 __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;}
4076 __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;}
4077 __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);
4080 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":523
4082 * if ps_process_raw(self.ps, cdata, len, no_search, full_utt) < 0:
4083 * raise RuntimeError, "Failed to process %d samples of audio data" % len # <<<<<<<<<<<<<<
4085 * def ps_end_utt(self):
4087 __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;}
4088 __Pyx_GOTREF(__pyx_t_4);
4089 __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;}
4090 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4091 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4092 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), 0);
4093 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4094 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4099 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4102 __Pyx_XDECREF(__pyx_t_4);
4103 __Pyx_XDECREF(__pyx_t_5);
4104 __Pyx_AddTraceback("pocketsphinx.Decoder.process_raw");
4107 __Pyx_XGIVEREF(__pyx_r);
4108 __Pyx_RefNannyFinishContext();
4112 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":525
4113 * raise RuntimeError, "Failed to process %d samples of audio data" % len
4115 * def ps_end_utt(self): # <<<<<<<<<<<<<<
4117 * Finish processing an utterance.
4120 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4121 static char __pyx_doc_12pocketsphinx_7Decoder_ps_end_utt[] = "\n Finish processing an utterance.\n ";
4122 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4123 PyObject *__pyx_r = NULL;
4125 __Pyx_RefNannySetupContext("ps_end_utt");
4127 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":529
4128 * Finish processing an utterance.
4130 * if ps_end_utt(self.ps) < 0: # <<<<<<<<<<<<<<
4131 * raise RuntimeError, "Failed to stop utterance processing"
4134 __pyx_t_1 = (ps_end_utt(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps) < 0);
4137 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":530
4139 * if ps_end_utt(self.ps) < 0:
4140 * raise RuntimeError, "Failed to stop utterance processing" # <<<<<<<<<<<<<<
4142 * def get_hyp(self):
4144 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_10), 0);
4145 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4150 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4153 __Pyx_AddTraceback("pocketsphinx.Decoder.ps_end_utt");
4156 __Pyx_XGIVEREF(__pyx_r);
4157 __Pyx_RefNannyFinishContext();
4161 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":532
4162 * raise RuntimeError, "Failed to stop utterance processing"
4164 * def get_hyp(self): # <<<<<<<<<<<<<<
4166 * Get a hypothesis string.
4169 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_hyp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4170 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 ";
4171 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_hyp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4172 const char* __pyx_v_hyp;
4173 const char* __pyx_v_uttid;
4175 PyObject *__pyx_r = NULL;
4177 PyObject *__pyx_t_2 = NULL;
4178 PyObject *__pyx_t_3 = NULL;
4179 PyObject *__pyx_t_4 = NULL;
4180 PyObject *__pyx_t_5 = NULL;
4181 __Pyx_RefNannySetupContext("get_hyp");
4183 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":547
4186 * hyp = ps_get_hyp(self.ps, &score, &uttid) # <<<<<<<<<<<<<<
4190 __pyx_v_hyp = ps_get_hyp(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps, (&__pyx_v_score), (&__pyx_v_uttid));
4192 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":550
4195 * if hyp == NULL: # <<<<<<<<<<<<<<
4196 * return None, uttid, 0
4199 __pyx_t_1 = (__pyx_v_hyp == NULL);
4202 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":551
4205 * return None, uttid, 0 # <<<<<<<<<<<<<<
4207 * return hyp, uttid, score
4209 __Pyx_XDECREF(__pyx_r);
4210 __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;}
4211 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4212 __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;}
4213 __Pyx_GOTREF(__pyx_t_3);
4214 __Pyx_INCREF(Py_None);
4215 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
4216 __Pyx_GIVEREF(Py_None);
4217 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
4218 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
4219 __Pyx_INCREF(__pyx_int_0);
4220 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
4221 __Pyx_GIVEREF(__pyx_int_0);
4223 __pyx_r = __pyx_t_3;
4230 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":553
4231 * return None, uttid, 0
4233 * return hyp, uttid, score # <<<<<<<<<<<<<<
4235 * def get_prob(self):
4237 __Pyx_XDECREF(__pyx_r);
4238 __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;}
4239 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4240 __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;}
4241 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4242 __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;}
4243 __Pyx_GOTREF(__pyx_t_4);
4244 __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;}
4245 __Pyx_GOTREF(__pyx_t_5);
4246 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
4247 __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
4248 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_2));
4249 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
4250 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
4251 __Pyx_GIVEREF(__pyx_t_4);
4255 __pyx_r = __pyx_t_5;
4259 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4262 __Pyx_XDECREF(__pyx_t_2);
4263 __Pyx_XDECREF(__pyx_t_3);
4264 __Pyx_XDECREF(__pyx_t_4);
4265 __Pyx_XDECREF(__pyx_t_5);
4266 __Pyx_AddTraceback("pocketsphinx.Decoder.get_hyp");
4269 __Pyx_XGIVEREF(__pyx_r);
4270 __Pyx_RefNannyFinishContext();
4274 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":555
4275 * return hyp, uttid, score
4277 * def get_prob(self): # <<<<<<<<<<<<<<
4279 * Get a posterior probability.
4282 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_prob(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4283 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";
4284 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_prob(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4285 logmath_t *__pyx_v_lmath;
4286 const char* __pyx_v_uttid;
4287 PyObject *__pyx_r = NULL;
4288 PyObject *__pyx_t_1 = NULL;
4289 __Pyx_RefNannySetupContext("get_prob");
4291 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":566
4292 * cdef logmath_t *lmath
4293 * cdef const_char_ptr uttid
4294 * lmath = ps_get_logmath(self.ps) # <<<<<<<<<<<<<<
4295 * return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))
4298 __pyx_v_lmath = ps_get_logmath(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4300 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":567
4301 * cdef const_char_ptr uttid
4302 * lmath = ps_get_logmath(self.ps)
4303 * return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid)) # <<<<<<<<<<<<<<
4305 * def get_lattice(self):
4307 __Pyx_XDECREF(__pyx_r);
4308 __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;}
4309 __Pyx_GOTREF(__pyx_t_1);
4310 __pyx_r = __pyx_t_1;
4314 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4317 __Pyx_XDECREF(__pyx_t_1);
4318 __Pyx_AddTraceback("pocketsphinx.Decoder.get_prob");
4321 __Pyx_XGIVEREF(__pyx_r);
4322 __Pyx_RefNannyFinishContext();
4326 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":569
4327 * return sb.logmath_exp(lmath, ps_get_prob(self.ps, &uttid))
4329 * def get_lattice(self): # <<<<<<<<<<<<<<
4331 * Get the word lattice.
4334 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4335 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 ";
4336 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4337 ps_lattice_t *__pyx_v_dag;
4338 struct __pyx_obj_12pocketsphinx_Lattice *__pyx_v_lat;
4339 PyObject *__pyx_r = NULL;
4341 PyObject *__pyx_t_2 = NULL;
4342 __Pyx_RefNannySetupContext("get_lattice");
4343 __pyx_v_lat = ((struct __pyx_obj_12pocketsphinx_Lattice *)Py_None); __Pyx_INCREF(Py_None);
4345 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":582
4348 * dag = ps_get_lattice(self.ps) # <<<<<<<<<<<<<<
4350 * raise RuntimeError, "Failed to create word lattice"
4352 __pyx_v_dag = ps_get_lattice(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4354 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":583
4356 * dag = ps_get_lattice(self.ps)
4357 * if dag == NULL: # <<<<<<<<<<<<<<
4358 * raise RuntimeError, "Failed to create word lattice"
4361 __pyx_t_1 = (__pyx_v_dag == NULL);
4364 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":584
4365 * dag = ps_get_lattice(self.ps)
4367 * raise RuntimeError, "Failed to create word lattice" # <<<<<<<<<<<<<<
4371 __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_11), 0);
4372 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4377 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":585
4379 * raise RuntimeError, "Failed to create word lattice"
4380 * lat = Lattice() # <<<<<<<<<<<<<<
4384 __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;}
4385 __Pyx_GOTREF(__pyx_t_2);
4386 __Pyx_DECREF(((PyObject *)__pyx_v_lat));
4387 __pyx_v_lat = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_t_2);
4390 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":586
4391 * raise RuntimeError, "Failed to create word lattice"
4393 * lat.set_dag(dag) # <<<<<<<<<<<<<<
4397 __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;}
4398 __Pyx_GOTREF(__pyx_t_2);
4399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4401 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":587
4404 * return lat # <<<<<<<<<<<<<<
4406 * def get_lmset(self):
4408 __Pyx_XDECREF(__pyx_r);
4409 __Pyx_INCREF(((PyObject *)__pyx_v_lat));
4410 __pyx_r = ((PyObject *)__pyx_v_lat);
4413 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4416 __Pyx_XDECREF(__pyx_t_2);
4417 __Pyx_AddTraceback("pocketsphinx.Decoder.get_lattice");
4420 __Pyx_DECREF((PyObject *)__pyx_v_lat);
4421 __Pyx_XGIVEREF(__pyx_r);
4422 __Pyx_RefNannyFinishContext();
4426 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":589
4429 * def get_lmset(self): # <<<<<<<<<<<<<<
4431 * Get the language model set.
4434 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lmset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4435 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 ";
4436 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_get_lmset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4437 ngram_model_t *__pyx_v_clm;
4438 logmath_t *__pyx_v_lmath;
4439 cmd_ln_t *__pyx_v_config;
4440 struct __pyx_obj_10sphinxbase_NGramModel *__pyx_v_lm;
4441 PyObject *__pyx_r = NULL;
4442 PyObject *__pyx_t_1 = NULL;
4443 __Pyx_RefNannySetupContext("get_lmset");
4444 __pyx_v_lm = ((struct __pyx_obj_10sphinxbase_NGramModel *)Py_None); __Pyx_INCREF(Py_None);
4446 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":604
4447 * cdef NGramModel lm
4449 * clm = ps_get_lmset(self.ps) # <<<<<<<<<<<<<<
4453 __pyx_v_clm = ps_get_lmset(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4455 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":605
4457 * clm = ps_get_lmset(self.ps)
4458 * lm = NGramModel() # <<<<<<<<<<<<<<
4460 * lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4462 __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;}
4463 __Pyx_GOTREF(__pyx_t_1);
4464 __Pyx_DECREF(((PyObject *)__pyx_v_lm));
4465 __pyx_v_lm = ((struct __pyx_obj_10sphinxbase_NGramModel *)__pyx_t_1);
4468 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":606
4469 * clm = ps_get_lmset(self.ps)
4471 * lm.set_lm(clm) # <<<<<<<<<<<<<<
4472 * lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4473 * lm.set_lmath(lmath)
4475 __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;}
4476 __Pyx_GOTREF(__pyx_t_1);
4477 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4479 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":607
4482 * lmath = sb.logmath_retain(ps_get_logmath(self.ps)) # <<<<<<<<<<<<<<
4483 * lm.set_lmath(lmath)
4484 * config = ps_get_config(self.ps)
4486 __pyx_v_lmath = logmath_retain(ps_get_logmath(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps));
4488 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":608
4490 * lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4491 * lm.set_lmath(lmath) # <<<<<<<<<<<<<<
4492 * config = ps_get_config(self.ps)
4493 * # This is not necessarily true but it will have to do
4495 __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;}
4496 __Pyx_GOTREF(__pyx_t_1);
4497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4499 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":609
4500 * lmath = sb.logmath_retain(ps_get_logmath(self.ps))
4501 * lm.set_lmath(lmath)
4502 * config = ps_get_config(self.ps) # <<<<<<<<<<<<<<
4503 * # This is not necessarily true but it will have to do
4504 * lm.lw = sb.cmd_ln_float32_r(config, "-lw")
4506 __pyx_v_config = ps_get_config(((struct __pyx_obj_12pocketsphinx_Decoder *)__pyx_v_self)->ps);
4508 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":611
4509 * config = ps_get_config(self.ps)
4510 * # This is not necessarily true but it will have to do
4511 * lm.lw = sb.cmd_ln_float32_r(config, "-lw") # <<<<<<<<<<<<<<
4512 * lm.wip = sb.cmd_ln_float32_r(config, "-wip")
4513 * lm.uw = sb.cmd_ln_float32_r(config, "-uw")
4515 __pyx_v_lm->lw = cmd_ln_float32_r(__pyx_v_config, __pyx_k_12);
4517 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":612
4518 * # This is not necessarily true but it will have to do
4519 * lm.lw = sb.cmd_ln_float32_r(config, "-lw")
4520 * lm.wip = sb.cmd_ln_float32_r(config, "-wip") # <<<<<<<<<<<<<<
4521 * lm.uw = sb.cmd_ln_float32_r(config, "-uw")
4524 __pyx_v_lm->wip = cmd_ln_float32_r(__pyx_v_config, __pyx_k_13);
4526 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":613
4527 * lm.lw = sb.cmd_ln_float32_r(config, "-lw")
4528 * lm.wip = sb.cmd_ln_float32_r(config, "-wip")
4529 * lm.uw = sb.cmd_ln_float32_r(config, "-uw") # <<<<<<<<<<<<<<
4533 __pyx_v_lm->uw = cmd_ln_float32_r(__pyx_v_config, __pyx_k_14);
4535 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":614
4536 * lm.wip = sb.cmd_ln_float32_r(config, "-wip")
4537 * lm.uw = sb.cmd_ln_float32_r(config, "-uw")
4538 * return lm # <<<<<<<<<<<<<<
4540 * def add_word(self, word, phones, update=True):
4542 __Pyx_XDECREF(__pyx_r);
4543 __Pyx_INCREF(((PyObject *)__pyx_v_lm));
4544 __pyx_r = ((PyObject *)__pyx_v_lm);
4547 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4550 __Pyx_XDECREF(__pyx_t_1);
4551 __Pyx_AddTraceback("pocketsphinx.Decoder.get_lmset");
4554 __Pyx_DECREF((PyObject *)__pyx_v_lm);
4555 __Pyx_XGIVEREF(__pyx_r);
4556 __Pyx_RefNannyFinishContext();
4560 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":616
4563 * def add_word(self, word, phones, update=True): # <<<<<<<<<<<<<<
4565 * Add a word to the dictionary and current language model.
4568 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_add_word(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4569 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 ";
4570 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_add_word(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4571 PyObject *__pyx_v_word = 0;
4572 PyObject *__pyx_v_phones = 0;
4573 PyObject *__pyx_v_update = 0;
4574 PyObject *__pyx_r = NULL;
4578 PyObject *__pyx_t_4 = NULL;
4579 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__phones,&__pyx_n_s__update,0};
4580 __Pyx_RefNannySetupContext("add_word");
4581 if (unlikely(__pyx_kwds)) {
4582 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4583 PyObject* values[3] = {0,0,0};
4584 values[2] = __pyx_k_15;
4585 switch (PyTuple_GET_SIZE(__pyx_args)) {
4586 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4587 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4588 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4590 default: goto __pyx_L5_argtuple_error;
4592 switch (PyTuple_GET_SIZE(__pyx_args)) {
4594 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word);
4595 if (likely(values[0])) kw_args--;
4596 else goto __pyx_L5_argtuple_error;
4598 values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__phones);
4599 if (likely(values[1])) kw_args--;
4601 __Pyx_RaiseArgtupleInvalid("add_word", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4605 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__update);
4606 if (value) { values[2] = value; kw_args--; }
4609 if (unlikely(kw_args > 0)) {
4610 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;}
4612 __pyx_v_word = values[0];
4613 __pyx_v_phones = values[1];
4614 __pyx_v_update = values[2];
4616 __pyx_v_update = __pyx_k_15;
4617 switch (PyTuple_GET_SIZE(__pyx_args)) {
4619 __pyx_v_update = PyTuple_GET_ITEM(__pyx_args, 2);
4621 __pyx_v_phones = PyTuple_GET_ITEM(__pyx_args, 1);
4622 __pyx_v_word = PyTuple_GET_ITEM(__pyx_args, 0);
4624 default: goto __pyx_L5_argtuple_error;
4627 goto __pyx_L4_argument_unpacking_done;
4628 __pyx_L5_argtuple_error:;
4629 __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;}
4631 __Pyx_AddTraceback("pocketsphinx.Decoder.add_word");
4632 __Pyx_RefNannyFinishContext();
4634 __pyx_L4_argument_unpacking_done:;
4636 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":629
4637 * @type update: bool
4639 * return ps_add_word(self.ps, word, phones, update) # <<<<<<<<<<<<<<
4641 * def load_dict(self, dictfile, fdictfile=None, format=None):
4643 __Pyx_XDECREF(__pyx_r);
4644 __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;}
4645 __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;}
4646 __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;}
4647 __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;}
4648 __Pyx_GOTREF(__pyx_t_4);
4649 __pyx_r = __pyx_t_4;
4653 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4656 __Pyx_XDECREF(__pyx_t_4);
4657 __Pyx_AddTraceback("pocketsphinx.Decoder.add_word");
4660 __Pyx_XGIVEREF(__pyx_r);
4661 __Pyx_RefNannyFinishContext();
4665 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":631
4666 * return ps_add_word(self.ps, word, phones, update)
4668 * def load_dict(self, dictfile, fdictfile=None, format=None): # <<<<<<<<<<<<<<
4670 * Load a new pronunciation dictionary.
4673 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_load_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4674 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 ";
4675 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_load_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4676 PyObject *__pyx_v_dictfile = 0;
4677 PyObject *__pyx_v_fdictfile = 0;
4678 PyObject *__pyx_v_format = 0;
4679 PyObject *__pyx_r = NULL;
4683 PyObject *__pyx_t_4 = NULL;
4684 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dictfile,&__pyx_n_s__fdictfile,&__pyx_n_s__format,0};
4685 __Pyx_RefNannySetupContext("load_dict");
4686 if (unlikely(__pyx_kwds)) {
4687 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4688 PyObject* values[3] = {0,0,0};
4689 values[1] = ((PyObject *)Py_None);
4690 values[2] = ((PyObject *)Py_None);
4691 switch (PyTuple_GET_SIZE(__pyx_args)) {
4692 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4693 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4694 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4696 default: goto __pyx_L5_argtuple_error;
4698 switch (PyTuple_GET_SIZE(__pyx_args)) {
4700 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dictfile);
4701 if (likely(values[0])) kw_args--;
4702 else goto __pyx_L5_argtuple_error;
4705 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fdictfile);
4706 if (value) { values[1] = value; kw_args--; }
4710 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
4711 if (value) { values[2] = value; kw_args--; }
4714 if (unlikely(kw_args > 0)) {
4715 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;}
4717 __pyx_v_dictfile = values[0];
4718 __pyx_v_fdictfile = values[1];
4719 __pyx_v_format = values[2];
4721 __pyx_v_fdictfile = ((PyObject *)Py_None);
4722 __pyx_v_format = ((PyObject *)Py_None);
4723 switch (PyTuple_GET_SIZE(__pyx_args)) {
4724 case 3: __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 2);
4725 case 2: __pyx_v_fdictfile = PyTuple_GET_ITEM(__pyx_args, 1);
4726 case 1: __pyx_v_dictfile = PyTuple_GET_ITEM(__pyx_args, 0);
4728 default: goto __pyx_L5_argtuple_error;
4731 goto __pyx_L4_argument_unpacking_done;
4732 __pyx_L5_argtuple_error:;
4733 __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;}
4735 __Pyx_AddTraceback("pocketsphinx.Decoder.load_dict");
4736 __Pyx_RefNannyFinishContext();
4738 __pyx_L4_argument_unpacking_done:;
4740 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":642
4743 * return ps_load_dict(self.ps, dictfile, fdictfile, format) # <<<<<<<<<<<<<<
4745 * def save_dict(self, dictfile, format=None):
4747 __Pyx_XDECREF(__pyx_r);
4748 __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;}
4749 __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;}
4750 __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;}
4751 __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;}
4752 __Pyx_GOTREF(__pyx_t_4);
4753 __pyx_r = __pyx_t_4;
4757 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4760 __Pyx_XDECREF(__pyx_t_4);
4761 __Pyx_AddTraceback("pocketsphinx.Decoder.load_dict");
4764 __Pyx_XGIVEREF(__pyx_r);
4765 __Pyx_RefNannyFinishContext();
4769 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":644
4770 * return ps_load_dict(self.ps, dictfile, fdictfile, format)
4772 * def save_dict(self, dictfile, format=None): # <<<<<<<<<<<<<<
4774 * Save current pronunciation dictionary to a file.
4777 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_save_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4778 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 ";
4779 static PyObject *__pyx_pf_12pocketsphinx_7Decoder_save_dict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4780 PyObject *__pyx_v_dictfile = 0;
4781 PyObject *__pyx_v_format = 0;
4782 PyObject *__pyx_r = NULL;
4785 PyObject *__pyx_t_3 = NULL;
4786 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dictfile,&__pyx_n_s__format,0};
4787 __Pyx_RefNannySetupContext("save_dict");
4788 if (unlikely(__pyx_kwds)) {
4789 Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4790 PyObject* values[2] = {0,0};
4791 values[1] = ((PyObject *)Py_None);
4792 switch (PyTuple_GET_SIZE(__pyx_args)) {
4793 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4794 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4796 default: goto __pyx_L5_argtuple_error;
4798 switch (PyTuple_GET_SIZE(__pyx_args)) {
4800 values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dictfile);
4801 if (likely(values[0])) kw_args--;
4802 else goto __pyx_L5_argtuple_error;
4805 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
4806 if (value) { values[1] = value; kw_args--; }
4809 if (unlikely(kw_args > 0)) {
4810 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;}
4812 __pyx_v_dictfile = values[0];
4813 __pyx_v_format = values[1];
4815 __pyx_v_format = ((PyObject *)Py_None);
4816 switch (PyTuple_GET_SIZE(__pyx_args)) {
4817 case 2: __pyx_v_format = PyTuple_GET_ITEM(__pyx_args, 1);
4818 case 1: __pyx_v_dictfile = PyTuple_GET_ITEM(__pyx_args, 0);
4820 default: goto __pyx_L5_argtuple_error;
4823 goto __pyx_L4_argument_unpacking_done;
4824 __pyx_L5_argtuple_error:;
4825 __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;}
4827 __Pyx_AddTraceback("pocketsphinx.Decoder.save_dict");
4828 __Pyx_RefNannyFinishContext();
4830 __pyx_L4_argument_unpacking_done:;
4832 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":653
4835 * return ps_save_dict(self.ps, dictfile, format) # <<<<<<<<<<<<<<
4837 __Pyx_XDECREF(__pyx_r);
4838 __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;}
4839 __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;}
4840 __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;}
4841 __Pyx_GOTREF(__pyx_t_3);
4842 __pyx_r = __pyx_t_3;
4846 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4849 __Pyx_XDECREF(__pyx_t_3);
4850 __Pyx_AddTraceback("pocketsphinx.Decoder.save_dict");
4853 __Pyx_XGIVEREF(__pyx_r);
4854 __Pyx_RefNannyFinishContext();
4858 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":141
4859 * cdef ngram_model_t *lm
4860 * cdef logmath_t *lmath
4861 * cdef readonly float lw, wip, uw # <<<<<<<<<<<<<<
4863 * cdef set_lm(NGramModel self, ngram_model_t *lm)
4866 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2lw___get__(PyObject *__pyx_v_self); /*proto*/
4867 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2lw___get__(PyObject *__pyx_v_self) {
4868 PyObject *__pyx_r = NULL;
4869 PyObject *__pyx_t_1 = NULL;
4870 __Pyx_RefNannySetupContext("__get__");
4871 __Pyx_XDECREF(__pyx_r);
4872 __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;}
4873 __Pyx_GOTREF(__pyx_t_1);
4874 __pyx_r = __pyx_t_1;
4878 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4881 __Pyx_XDECREF(__pyx_t_1);
4882 __Pyx_AddTraceback("sphinxbase.NGramModel.lw.__get__");
4885 __Pyx_XGIVEREF(__pyx_r);
4886 __Pyx_RefNannyFinishContext();
4890 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_3wip___get__(PyObject *__pyx_v_self); /*proto*/
4891 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_3wip___get__(PyObject *__pyx_v_self) {
4892 PyObject *__pyx_r = NULL;
4893 PyObject *__pyx_t_1 = NULL;
4894 __Pyx_RefNannySetupContext("__get__");
4895 __Pyx_XDECREF(__pyx_r);
4896 __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;}
4897 __Pyx_GOTREF(__pyx_t_1);
4898 __pyx_r = __pyx_t_1;
4902 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4905 __Pyx_XDECREF(__pyx_t_1);
4906 __Pyx_AddTraceback("sphinxbase.NGramModel.wip.__get__");
4909 __Pyx_XGIVEREF(__pyx_r);
4910 __Pyx_RefNannyFinishContext();
4914 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2uw___get__(PyObject *__pyx_v_self); /*proto*/
4915 static PyObject *__pyx_pf_10sphinxbase_10NGramModel_2uw___get__(PyObject *__pyx_v_self) {
4916 PyObject *__pyx_r = NULL;
4917 PyObject *__pyx_t_1 = NULL;
4918 __Pyx_RefNannySetupContext("__get__");
4919 __Pyx_XDECREF(__pyx_r);
4920 __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;}
4921 __Pyx_GOTREF(__pyx_t_1);
4922 __pyx_r = __pyx_t_1;
4926 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4929 __Pyx_XDECREF(__pyx_t_1);
4930 __Pyx_AddTraceback("sphinxbase.NGramModel.uw.__get__");
4933 __Pyx_XGIVEREF(__pyx_r);
4934 __Pyx_RefNannyFinishContext();
4938 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":154
4939 * cdef int first_item
4941 * cdef readonly float log_prob, log_bowt # <<<<<<<<<<<<<<
4942 * cdef readonly object words
4946 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_prob___get__(PyObject *__pyx_v_self); /*proto*/
4947 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_prob___get__(PyObject *__pyx_v_self) {
4948 PyObject *__pyx_r = NULL;
4949 PyObject *__pyx_t_1 = NULL;
4950 __Pyx_RefNannySetupContext("__get__");
4951 __Pyx_XDECREF(__pyx_r);
4952 __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;}
4953 __Pyx_GOTREF(__pyx_t_1);
4954 __pyx_r = __pyx_t_1;
4958 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4961 __Pyx_XDECREF(__pyx_t_1);
4962 __Pyx_AddTraceback("sphinxbase.NGramIter.log_prob.__get__");
4965 __Pyx_XGIVEREF(__pyx_r);
4966 __Pyx_RefNannyFinishContext();
4970 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_bowt___get__(PyObject *__pyx_v_self); /*proto*/
4971 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_8log_bowt___get__(PyObject *__pyx_v_self) {
4972 PyObject *__pyx_r = NULL;
4973 PyObject *__pyx_t_1 = NULL;
4974 __Pyx_RefNannySetupContext("__get__");
4975 __Pyx_XDECREF(__pyx_r);
4976 __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;}
4977 __Pyx_GOTREF(__pyx_t_1);
4978 __pyx_r = __pyx_t_1;
4982 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4985 __Pyx_XDECREF(__pyx_t_1);
4986 __Pyx_AddTraceback("sphinxbase.NGramIter.log_bowt.__get__");
4989 __Pyx_XGIVEREF(__pyx_r);
4990 __Pyx_RefNannyFinishContext();
4994 /* "/home/shmyrev/projects/asr/pocketsphinx/../sphinxbase/python/sphinxbase.pxd":155
4996 * cdef readonly float log_prob, log_bowt
4997 * cdef readonly object words # <<<<<<<<<<<<<<
4999 * cdef set_iter(NGramIter self, ngram_iter_t *itor)
5002 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_5words___get__(PyObject *__pyx_v_self); /*proto*/
5003 static PyObject *__pyx_pf_10sphinxbase_9NGramIter_5words___get__(PyObject *__pyx_v_self) {
5004 PyObject *__pyx_r = NULL;
5005 __Pyx_RefNannySetupContext("__get__");
5006 __Pyx_XDECREF(__pyx_r);
5007 __Pyx_INCREF(((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->words);
5008 __pyx_r = ((struct __pyx_obj_10sphinxbase_NGramIter *)__pyx_v_self)->words;
5011 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5013 __Pyx_XGIVEREF(__pyx_r);
5014 __Pyx_RefNannyFinishContext();
5018 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":149
5019 * cdef set_dag(Lattice self, ps_lattice_t *dag)
5020 * cdef set_boxed(Lattice self, box)
5021 * cdef readonly n_frames # <<<<<<<<<<<<<<
5023 * cdef class LatLink:
5026 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(PyObject *__pyx_v_self); /*proto*/
5027 static PyObject *__pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(PyObject *__pyx_v_self) {
5028 PyObject *__pyx_r = NULL;
5029 __Pyx_RefNannySetupContext("__get__");
5030 __Pyx_XDECREF(__pyx_r);
5031 __Pyx_INCREF(((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->n_frames);
5032 __pyx_r = ((struct __pyx_obj_12pocketsphinx_Lattice *)__pyx_v_self)->n_frames;
5035 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5037 __Pyx_XGIVEREF(__pyx_r);
5038 __Pyx_RefNannyFinishContext();
5042 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":154
5043 * cdef ps_latlink_t *link
5044 * cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5045 * cdef readonly char *word, *baseword # <<<<<<<<<<<<<<
5046 * cdef readonly int sf, ef
5047 * cdef readonly double prob
5050 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4word___get__(PyObject *__pyx_v_self); /*proto*/
5051 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4word___get__(PyObject *__pyx_v_self) {
5052 PyObject *__pyx_r = NULL;
5053 PyObject *__pyx_t_1 = NULL;
5054 __Pyx_RefNannySetupContext("__get__");
5055 __Pyx_XDECREF(__pyx_r);
5056 __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;}
5057 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5058 __pyx_r = ((PyObject *)__pyx_t_1);
5062 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5065 __Pyx_XDECREF(__pyx_t_1);
5066 __Pyx_AddTraceback("pocketsphinx.LatLink.word.__get__");
5069 __Pyx_XGIVEREF(__pyx_r);
5070 __Pyx_RefNannyFinishContext();
5074 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(PyObject *__pyx_v_self); /*proto*/
5075 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(PyObject *__pyx_v_self) {
5076 PyObject *__pyx_r = NULL;
5077 PyObject *__pyx_t_1 = NULL;
5078 __Pyx_RefNannySetupContext("__get__");
5079 __Pyx_XDECREF(__pyx_r);
5080 __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;}
5081 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5082 __pyx_r = ((PyObject *)__pyx_t_1);
5086 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5089 __Pyx_XDECREF(__pyx_t_1);
5090 __Pyx_AddTraceback("pocketsphinx.LatLink.baseword.__get__");
5093 __Pyx_XGIVEREF(__pyx_r);
5094 __Pyx_RefNannyFinishContext();
5098 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":155
5099 * cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5100 * cdef readonly char *word, *baseword
5101 * cdef readonly int sf, ef # <<<<<<<<<<<<<<
5102 * cdef readonly double prob
5103 * cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
5106 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2sf___get__(PyObject *__pyx_v_self); /*proto*/
5107 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2sf___get__(PyObject *__pyx_v_self) {
5108 PyObject *__pyx_r = NULL;
5109 PyObject *__pyx_t_1 = NULL;
5110 __Pyx_RefNannySetupContext("__get__");
5111 __Pyx_XDECREF(__pyx_r);
5112 __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;}
5113 __Pyx_GOTREF(__pyx_t_1);
5114 __pyx_r = __pyx_t_1;
5118 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5121 __Pyx_XDECREF(__pyx_t_1);
5122 __Pyx_AddTraceback("pocketsphinx.LatLink.sf.__get__");
5125 __Pyx_XGIVEREF(__pyx_r);
5126 __Pyx_RefNannyFinishContext();
5130 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2ef___get__(PyObject *__pyx_v_self); /*proto*/
5131 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_2ef___get__(PyObject *__pyx_v_self) {
5132 PyObject *__pyx_r = NULL;
5133 PyObject *__pyx_t_1 = NULL;
5134 __Pyx_RefNannySetupContext("__get__");
5135 __Pyx_XDECREF(__pyx_r);
5136 __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;}
5137 __Pyx_GOTREF(__pyx_t_1);
5138 __pyx_r = __pyx_t_1;
5142 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5145 __Pyx_XDECREF(__pyx_t_1);
5146 __Pyx_AddTraceback("pocketsphinx.LatLink.ef.__get__");
5149 __Pyx_XGIVEREF(__pyx_r);
5150 __Pyx_RefNannyFinishContext();
5154 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":156
5155 * cdef readonly char *word, *baseword
5156 * cdef readonly int sf, ef
5157 * cdef readonly double prob # <<<<<<<<<<<<<<
5158 * cdef set_link(LatLink self, ps_lattice_t *dag, ps_latlink_t *link)
5162 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4prob___get__(PyObject *__pyx_v_self); /*proto*/
5163 static PyObject *__pyx_pf_12pocketsphinx_7LatLink_4prob___get__(PyObject *__pyx_v_self) {
5164 PyObject *__pyx_r = NULL;
5165 PyObject *__pyx_t_1 = NULL;
5166 __Pyx_RefNannySetupContext("__get__");
5167 __Pyx_XDECREF(__pyx_r);
5168 __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;}
5169 __Pyx_GOTREF(__pyx_t_1);
5170 __pyx_r = __pyx_t_1;
5174 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5177 __Pyx_XDECREF(__pyx_t_1);
5178 __Pyx_AddTraceback("pocketsphinx.LatLink.prob.__get__");
5181 __Pyx_XGIVEREF(__pyx_r);
5182 __Pyx_RefNannyFinishContext();
5186 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":167
5187 * cdef ps_latnode_t *node
5188 * cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5189 * cdef readonly char *word, *baseword # <<<<<<<<<<<<<<
5190 * cdef readonly int sf, fef, lef
5191 * cdef readonly double prob
5194 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4word___get__(PyObject *__pyx_v_self); /*proto*/
5195 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4word___get__(PyObject *__pyx_v_self) {
5196 PyObject *__pyx_r = NULL;
5197 PyObject *__pyx_t_1 = NULL;
5198 __Pyx_RefNannySetupContext("__get__");
5199 __Pyx_XDECREF(__pyx_r);
5200 __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;}
5201 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5202 __pyx_r = ((PyObject *)__pyx_t_1);
5206 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5209 __Pyx_XDECREF(__pyx_t_1);
5210 __Pyx_AddTraceback("pocketsphinx.LatNode.word.__get__");
5213 __Pyx_XGIVEREF(__pyx_r);
5214 __Pyx_RefNannyFinishContext();
5218 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(PyObject *__pyx_v_self); /*proto*/
5219 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(PyObject *__pyx_v_self) {
5220 PyObject *__pyx_r = NULL;
5221 PyObject *__pyx_t_1 = NULL;
5222 __Pyx_RefNannySetupContext("__get__");
5223 __Pyx_XDECREF(__pyx_r);
5224 __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;}
5225 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5226 __pyx_r = ((PyObject *)__pyx_t_1);
5230 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5233 __Pyx_XDECREF(__pyx_t_1);
5234 __Pyx_AddTraceback("pocketsphinx.LatNode.baseword.__get__");
5237 __Pyx_XGIVEREF(__pyx_r);
5238 __Pyx_RefNannyFinishContext();
5242 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":168
5243 * cdef ps_lattice_t *dag # FIXME: This may or may not cause memory leaks?
5244 * cdef readonly char *word, *baseword
5245 * cdef readonly int sf, fef, lef # <<<<<<<<<<<<<<
5246 * cdef readonly double prob
5247 * cdef readonly LatLink best_exit
5250 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_2sf___get__(PyObject *__pyx_v_self); /*proto*/
5251 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_2sf___get__(PyObject *__pyx_v_self) {
5252 PyObject *__pyx_r = NULL;
5253 PyObject *__pyx_t_1 = NULL;
5254 __Pyx_RefNannySetupContext("__get__");
5255 __Pyx_XDECREF(__pyx_r);
5256 __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;}
5257 __Pyx_GOTREF(__pyx_t_1);
5258 __pyx_r = __pyx_t_1;
5262 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5265 __Pyx_XDECREF(__pyx_t_1);
5266 __Pyx_AddTraceback("pocketsphinx.LatNode.sf.__get__");
5269 __Pyx_XGIVEREF(__pyx_r);
5270 __Pyx_RefNannyFinishContext();
5274 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3fef___get__(PyObject *__pyx_v_self); /*proto*/
5275 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3fef___get__(PyObject *__pyx_v_self) {
5276 PyObject *__pyx_r = NULL;
5277 PyObject *__pyx_t_1 = NULL;
5278 __Pyx_RefNannySetupContext("__get__");
5279 __Pyx_XDECREF(__pyx_r);
5280 __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;}
5281 __Pyx_GOTREF(__pyx_t_1);
5282 __pyx_r = __pyx_t_1;
5286 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5289 __Pyx_XDECREF(__pyx_t_1);
5290 __Pyx_AddTraceback("pocketsphinx.LatNode.fef.__get__");
5293 __Pyx_XGIVEREF(__pyx_r);
5294 __Pyx_RefNannyFinishContext();
5298 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3lef___get__(PyObject *__pyx_v_self); /*proto*/
5299 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_3lef___get__(PyObject *__pyx_v_self) {
5300 PyObject *__pyx_r = NULL;
5301 PyObject *__pyx_t_1 = NULL;
5302 __Pyx_RefNannySetupContext("__get__");
5303 __Pyx_XDECREF(__pyx_r);
5304 __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;}
5305 __Pyx_GOTREF(__pyx_t_1);
5306 __pyx_r = __pyx_t_1;
5310 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5313 __Pyx_XDECREF(__pyx_t_1);
5314 __Pyx_AddTraceback("pocketsphinx.LatNode.lef.__get__");
5317 __Pyx_XGIVEREF(__pyx_r);
5318 __Pyx_RefNannyFinishContext();
5322 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":169
5323 * cdef readonly char *word, *baseword
5324 * cdef readonly int sf, fef, lef
5325 * cdef readonly double prob # <<<<<<<<<<<<<<
5326 * cdef readonly LatLink best_exit
5327 * cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
5330 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4prob___get__(PyObject *__pyx_v_self); /*proto*/
5331 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_4prob___get__(PyObject *__pyx_v_self) {
5332 PyObject *__pyx_r = NULL;
5333 PyObject *__pyx_t_1 = NULL;
5334 __Pyx_RefNannySetupContext("__get__");
5335 __Pyx_XDECREF(__pyx_r);
5336 __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;}
5337 __Pyx_GOTREF(__pyx_t_1);
5338 __pyx_r = __pyx_t_1;
5342 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5345 __Pyx_XDECREF(__pyx_t_1);
5346 __Pyx_AddTraceback("pocketsphinx.LatNode.prob.__get__");
5349 __Pyx_XGIVEREF(__pyx_r);
5350 __Pyx_RefNannyFinishContext();
5354 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":170
5355 * cdef readonly int sf, fef, lef
5356 * cdef readonly double prob
5357 * cdef readonly LatLink best_exit # <<<<<<<<<<<<<<
5358 * cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
5362 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(PyObject *__pyx_v_self); /*proto*/
5363 static PyObject *__pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(PyObject *__pyx_v_self) {
5364 PyObject *__pyx_r = NULL;
5365 __Pyx_RefNannySetupContext("__get__");
5366 __Pyx_XDECREF(__pyx_r);
5367 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->best_exit));
5368 __pyx_r = ((PyObject *)((struct __pyx_obj_12pocketsphinx_LatNode *)__pyx_v_self)->best_exit);
5371 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5373 __Pyx_XGIVEREF(__pyx_r);
5374 __Pyx_RefNannyFinishContext();
5377 static struct __pyx_vtabstruct_12pocketsphinx_Decoder __pyx_vtable_12pocketsphinx_Decoder;
5379 static PyObject *__pyx_tp_new_12pocketsphinx_Decoder(PyTypeObject *t, PyObject *a, PyObject *k) {
5380 struct __pyx_obj_12pocketsphinx_Decoder *p;
5381 PyObject *o = (*t->tp_alloc)(t, 0);
5383 p = ((struct __pyx_obj_12pocketsphinx_Decoder *)o);
5384 p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_Decoder;
5388 static void __pyx_tp_dealloc_12pocketsphinx_Decoder(PyObject *o) {
5390 PyObject *etype, *eval, *etb;
5391 PyErr_Fetch(&etype, &eval, &etb);
5393 __pyx_pf_12pocketsphinx_7Decoder___dealloc__(o);
5394 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
5396 PyErr_Restore(etype, eval, etb);
5398 (*Py_TYPE(o)->tp_free)(o);
5401 static PyMethodDef __pyx_methods_12pocketsphinx_Decoder[] = {
5402 {__Pyx_NAMESTR("decode_raw"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_decode_raw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_decode_raw)},
5403 {__Pyx_NAMESTR("decode_senscr"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_decode_senscr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_decode_senscr)},
5404 {__Pyx_NAMESTR("start_utt"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_start_utt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_start_utt)},
5405 {__Pyx_NAMESTR("process_raw"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_process_raw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_process_raw)},
5406 {__Pyx_NAMESTR("ps_end_utt"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_ps_end_utt, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_ps_end_utt)},
5407 {__Pyx_NAMESTR("get_hyp"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_hyp, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_hyp)},
5408 {__Pyx_NAMESTR("get_prob"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_prob, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_prob)},
5409 {__Pyx_NAMESTR("get_lattice"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_lattice, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_lattice)},
5410 {__Pyx_NAMESTR("get_lmset"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_get_lmset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_get_lmset)},
5411 {__Pyx_NAMESTR("add_word"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_add_word, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_add_word)},
5412 {__Pyx_NAMESTR("load_dict"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_load_dict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_load_dict)},
5413 {__Pyx_NAMESTR("save_dict"), (PyCFunction)__pyx_pf_12pocketsphinx_7Decoder_save_dict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Decoder_save_dict)},
5417 static PyNumberMethods __pyx_tp_as_number_Decoder = {
5421 #if PY_MAJOR_VERSION < 3
5437 #if PY_MAJOR_VERSION < 3
5441 #if PY_MAJOR_VERSION < 3
5447 #if PY_MAJOR_VERSION < 3
5450 #if PY_MAJOR_VERSION < 3
5453 0, /*nb_inplace_add*/
5454 0, /*nb_inplace_subtract*/
5455 0, /*nb_inplace_multiply*/
5456 #if PY_MAJOR_VERSION < 3
5457 0, /*nb_inplace_divide*/
5459 0, /*nb_inplace_remainder*/
5460 0, /*nb_inplace_power*/
5461 0, /*nb_inplace_lshift*/
5462 0, /*nb_inplace_rshift*/
5463 0, /*nb_inplace_and*/
5464 0, /*nb_inplace_xor*/
5465 0, /*nb_inplace_or*/
5466 0, /*nb_floor_divide*/
5467 0, /*nb_true_divide*/
5468 0, /*nb_inplace_floor_divide*/
5469 0, /*nb_inplace_true_divide*/
5470 #if PY_VERSION_HEX >= 0x02050000
5475 static PySequenceMethods __pyx_tp_as_sequence_Decoder = {
5484 0, /*sq_inplace_concat*/
5485 0, /*sq_inplace_repeat*/
5488 static PyMappingMethods __pyx_tp_as_mapping_Decoder = {
5491 0, /*mp_ass_subscript*/
5494 static PyBufferProcs __pyx_tp_as_buffer_Decoder = {
5495 #if PY_MAJOR_VERSION < 3
5496 0, /*bf_getreadbuffer*/
5498 #if PY_MAJOR_VERSION < 3
5499 0, /*bf_getwritebuffer*/
5501 #if PY_MAJOR_VERSION < 3
5502 0, /*bf_getsegcount*/
5504 #if PY_MAJOR_VERSION < 3
5505 0, /*bf_getcharbuffer*/
5507 #if PY_VERSION_HEX >= 0x02060000
5510 #if PY_VERSION_HEX >= 0x02060000
5511 0, /*bf_releasebuffer*/
5515 PyTypeObject __pyx_type_12pocketsphinx_Decoder = {
5516 PyVarObject_HEAD_INIT(0, 0)
5517 __Pyx_NAMESTR("pocketsphinx.Decoder"), /*tp_name*/
5518 sizeof(struct __pyx_obj_12pocketsphinx_Decoder), /*tp_basicsize*/
5520 __pyx_tp_dealloc_12pocketsphinx_Decoder, /*tp_dealloc*/
5524 #if PY_MAJOR_VERSION < 3
5530 &__pyx_tp_as_number_Decoder, /*tp_as_number*/
5531 &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/
5532 &__pyx_tp_as_mapping_Decoder, /*tp_as_mapping*/
5538 &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/
5539 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
5540 __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*/
5543 0, /*tp_richcompare*/
5544 0, /*tp_weaklistoffset*/
5547 __pyx_methods_12pocketsphinx_Decoder, /*tp_methods*/
5554 0, /*tp_dictoffset*/
5555 __pyx_pf_12pocketsphinx_7Decoder___init__, /*tp_init*/
5557 __pyx_tp_new_12pocketsphinx_Decoder, /*tp_new*/
5563 0, /*tp_subclasses*/
5566 #if PY_VERSION_HEX >= 0x02060000
5567 0, /*tp_version_tag*/
5570 static struct __pyx_vtabstruct_12pocketsphinx_Lattice __pyx_vtable_12pocketsphinx_Lattice;
5572 static PyObject *__pyx_tp_new_12pocketsphinx_Lattice(PyTypeObject *t, PyObject *a, PyObject *k) {
5573 struct __pyx_obj_12pocketsphinx_Lattice *p;
5574 PyObject *o = (*t->tp_alloc)(t, 0);
5576 p = ((struct __pyx_obj_12pocketsphinx_Lattice *)o);
5577 p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_Lattice;
5578 p->n_frames = Py_None; Py_INCREF(Py_None);
5582 static void __pyx_tp_dealloc_12pocketsphinx_Lattice(PyObject *o) {
5583 struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
5585 PyObject *etype, *eval, *etb;
5586 PyErr_Fetch(&etype, &eval, &etb);
5588 __pyx_pf_12pocketsphinx_7Lattice___dealloc__(o);
5589 if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
5591 PyErr_Restore(etype, eval, etb);
5593 Py_XDECREF(p->n_frames);
5594 (*Py_TYPE(o)->tp_free)(o);
5597 static int __pyx_tp_traverse_12pocketsphinx_Lattice(PyObject *o, visitproc v, void *a) {
5599 struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
5601 e = (*v)(p->n_frames, a); if (e) return e;
5606 static int __pyx_tp_clear_12pocketsphinx_Lattice(PyObject *o) {
5607 struct __pyx_obj_12pocketsphinx_Lattice *p = (struct __pyx_obj_12pocketsphinx_Lattice *)o;
5609 tmp = ((PyObject*)p->n_frames);
5610 p->n_frames = Py_None; Py_INCREF(Py_None);
5615 static PyObject *__pyx_getprop_12pocketsphinx_7Lattice_n_frames(PyObject *o, void *x) {
5616 return __pyx_pf_12pocketsphinx_7Lattice_8n_frames___get__(o);
5619 static PyMethodDef __pyx_methods_12pocketsphinx_Lattice[] = {
5620 {__Pyx_NAMESTR("bestpath"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_bestpath, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_bestpath)},
5621 {__Pyx_NAMESTR("posterior"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_posterior, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_posterior)},
5622 {__Pyx_NAMESTR("nodes"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_nodes, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_nodes)},
5623 {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_12pocketsphinx_7Lattice_write, METH_O, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7Lattice_write)},
5627 static struct PyGetSetDef __pyx_getsets_12pocketsphinx_Lattice[] = {
5628 {(char *)"n_frames", __pyx_getprop_12pocketsphinx_7Lattice_n_frames, 0, 0, 0},
5632 static PyNumberMethods __pyx_tp_as_number_Lattice = {
5636 #if PY_MAJOR_VERSION < 3
5652 #if PY_MAJOR_VERSION < 3
5656 #if PY_MAJOR_VERSION < 3
5662 #if PY_MAJOR_VERSION < 3
5665 #if PY_MAJOR_VERSION < 3
5668 0, /*nb_inplace_add*/
5669 0, /*nb_inplace_subtract*/
5670 0, /*nb_inplace_multiply*/
5671 #if PY_MAJOR_VERSION < 3
5672 0, /*nb_inplace_divide*/
5674 0, /*nb_inplace_remainder*/
5675 0, /*nb_inplace_power*/
5676 0, /*nb_inplace_lshift*/
5677 0, /*nb_inplace_rshift*/
5678 0, /*nb_inplace_and*/
5679 0, /*nb_inplace_xor*/
5680 0, /*nb_inplace_or*/
5681 0, /*nb_floor_divide*/
5682 0, /*nb_true_divide*/
5683 0, /*nb_inplace_floor_divide*/
5684 0, /*nb_inplace_true_divide*/
5685 #if PY_VERSION_HEX >= 0x02050000
5690 static PySequenceMethods __pyx_tp_as_sequence_Lattice = {
5699 0, /*sq_inplace_concat*/
5700 0, /*sq_inplace_repeat*/
5703 static PyMappingMethods __pyx_tp_as_mapping_Lattice = {
5706 0, /*mp_ass_subscript*/
5709 static PyBufferProcs __pyx_tp_as_buffer_Lattice = {
5710 #if PY_MAJOR_VERSION < 3
5711 0, /*bf_getreadbuffer*/
5713 #if PY_MAJOR_VERSION < 3
5714 0, /*bf_getwritebuffer*/
5716 #if PY_MAJOR_VERSION < 3
5717 0, /*bf_getsegcount*/
5719 #if PY_MAJOR_VERSION < 3
5720 0, /*bf_getcharbuffer*/
5722 #if PY_VERSION_HEX >= 0x02060000
5725 #if PY_VERSION_HEX >= 0x02060000
5726 0, /*bf_releasebuffer*/
5730 PyTypeObject __pyx_type_12pocketsphinx_Lattice = {
5731 PyVarObject_HEAD_INIT(0, 0)
5732 __Pyx_NAMESTR("pocketsphinx.Lattice"), /*tp_name*/
5733 sizeof(struct __pyx_obj_12pocketsphinx_Lattice), /*tp_basicsize*/
5735 __pyx_tp_dealloc_12pocketsphinx_Lattice, /*tp_dealloc*/
5739 #if PY_MAJOR_VERSION < 3
5745 &__pyx_tp_as_number_Lattice, /*tp_as_number*/
5746 &__pyx_tp_as_sequence_Lattice, /*tp_as_sequence*/
5747 &__pyx_tp_as_mapping_Lattice, /*tp_as_mapping*/
5753 &__pyx_tp_as_buffer_Lattice, /*tp_as_buffer*/
5754 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5755 __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*/
5756 __pyx_tp_traverse_12pocketsphinx_Lattice, /*tp_traverse*/
5757 __pyx_tp_clear_12pocketsphinx_Lattice, /*tp_clear*/
5758 0, /*tp_richcompare*/
5759 0, /*tp_weaklistoffset*/
5762 __pyx_methods_12pocketsphinx_Lattice, /*tp_methods*/
5764 __pyx_getsets_12pocketsphinx_Lattice, /*tp_getset*/
5769 0, /*tp_dictoffset*/
5770 __pyx_pf_12pocketsphinx_7Lattice___init__, /*tp_init*/
5772 __pyx_tp_new_12pocketsphinx_Lattice, /*tp_new*/
5778 0, /*tp_subclasses*/
5781 #if PY_VERSION_HEX >= 0x02060000
5782 0, /*tp_version_tag*/
5785 static struct __pyx_vtabstruct_12pocketsphinx_LatLink __pyx_vtable_12pocketsphinx_LatLink;
5787 static PyObject *__pyx_tp_new_12pocketsphinx_LatLink(PyTypeObject *t, PyObject *a, PyObject *k) {
5788 struct __pyx_obj_12pocketsphinx_LatLink *p;
5789 PyObject *o = (*t->tp_alloc)(t, 0);
5791 p = ((struct __pyx_obj_12pocketsphinx_LatLink *)o);
5792 p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_LatLink;
5793 if (__pyx_pf_12pocketsphinx_7LatLink___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
5794 Py_DECREF(o); o = 0;
5799 static void __pyx_tp_dealloc_12pocketsphinx_LatLink(PyObject *o) {
5800 (*Py_TYPE(o)->tp_free)(o);
5803 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_word(PyObject *o, void *x) {
5804 return __pyx_pf_12pocketsphinx_7LatLink_4word___get__(o);
5807 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_baseword(PyObject *o, void *x) {
5808 return __pyx_pf_12pocketsphinx_7LatLink_8baseword___get__(o);
5811 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_sf(PyObject *o, void *x) {
5812 return __pyx_pf_12pocketsphinx_7LatLink_2sf___get__(o);
5815 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_ef(PyObject *o, void *x) {
5816 return __pyx_pf_12pocketsphinx_7LatLink_2ef___get__(o);
5819 static PyObject *__pyx_getprop_12pocketsphinx_7LatLink_prob(PyObject *o, void *x) {
5820 return __pyx_pf_12pocketsphinx_7LatLink_4prob___get__(o);
5823 static PyMethodDef __pyx_methods_12pocketsphinx_LatLink[] = {
5824 {__Pyx_NAMESTR("nodes"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatLink_nodes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatLink_nodes)},
5825 {__Pyx_NAMESTR("pred"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatLink_pred, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatLink_pred)},
5829 static struct PyGetSetDef __pyx_getsets_12pocketsphinx_LatLink[] = {
5830 {(char *)"word", __pyx_getprop_12pocketsphinx_7LatLink_word, 0, 0, 0},
5831 {(char *)"baseword", __pyx_getprop_12pocketsphinx_7LatLink_baseword, 0, 0, 0},
5832 {(char *)"sf", __pyx_getprop_12pocketsphinx_7LatLink_sf, 0, 0, 0},
5833 {(char *)"ef", __pyx_getprop_12pocketsphinx_7LatLink_ef, 0, 0, 0},
5834 {(char *)"prob", __pyx_getprop_12pocketsphinx_7LatLink_prob, 0, 0, 0},
5838 static PyNumberMethods __pyx_tp_as_number_LatLink = {
5842 #if PY_MAJOR_VERSION < 3
5858 #if PY_MAJOR_VERSION < 3
5862 #if PY_MAJOR_VERSION < 3
5868 #if PY_MAJOR_VERSION < 3
5871 #if PY_MAJOR_VERSION < 3
5874 0, /*nb_inplace_add*/
5875 0, /*nb_inplace_subtract*/
5876 0, /*nb_inplace_multiply*/
5877 #if PY_MAJOR_VERSION < 3
5878 0, /*nb_inplace_divide*/
5880 0, /*nb_inplace_remainder*/
5881 0, /*nb_inplace_power*/
5882 0, /*nb_inplace_lshift*/
5883 0, /*nb_inplace_rshift*/
5884 0, /*nb_inplace_and*/
5885 0, /*nb_inplace_xor*/
5886 0, /*nb_inplace_or*/
5887 0, /*nb_floor_divide*/
5888 0, /*nb_true_divide*/
5889 0, /*nb_inplace_floor_divide*/
5890 0, /*nb_inplace_true_divide*/
5891 #if PY_VERSION_HEX >= 0x02050000
5896 static PySequenceMethods __pyx_tp_as_sequence_LatLink = {
5905 0, /*sq_inplace_concat*/
5906 0, /*sq_inplace_repeat*/
5909 static PyMappingMethods __pyx_tp_as_mapping_LatLink = {
5912 0, /*mp_ass_subscript*/
5915 static PyBufferProcs __pyx_tp_as_buffer_LatLink = {
5916 #if PY_MAJOR_VERSION < 3
5917 0, /*bf_getreadbuffer*/
5919 #if PY_MAJOR_VERSION < 3
5920 0, /*bf_getwritebuffer*/
5922 #if PY_MAJOR_VERSION < 3
5923 0, /*bf_getsegcount*/
5925 #if PY_MAJOR_VERSION < 3
5926 0, /*bf_getcharbuffer*/
5928 #if PY_VERSION_HEX >= 0x02060000
5931 #if PY_VERSION_HEX >= 0x02060000
5932 0, /*bf_releasebuffer*/
5936 PyTypeObject __pyx_type_12pocketsphinx_LatLink = {
5937 PyVarObject_HEAD_INIT(0, 0)
5938 __Pyx_NAMESTR("pocketsphinx.LatLink"), /*tp_name*/
5939 sizeof(struct __pyx_obj_12pocketsphinx_LatLink), /*tp_basicsize*/
5941 __pyx_tp_dealloc_12pocketsphinx_LatLink, /*tp_dealloc*/
5945 #if PY_MAJOR_VERSION < 3
5951 &__pyx_tp_as_number_LatLink, /*tp_as_number*/
5952 &__pyx_tp_as_sequence_LatLink, /*tp_as_sequence*/
5953 &__pyx_tp_as_mapping_LatLink, /*tp_as_mapping*/
5959 &__pyx_tp_as_buffer_LatLink, /*tp_as_buffer*/
5960 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
5961 __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*/
5964 0, /*tp_richcompare*/
5965 0, /*tp_weaklistoffset*/
5968 __pyx_methods_12pocketsphinx_LatLink, /*tp_methods*/
5970 __pyx_getsets_12pocketsphinx_LatLink, /*tp_getset*/
5975 0, /*tp_dictoffset*/
5978 __pyx_tp_new_12pocketsphinx_LatLink, /*tp_new*/
5984 0, /*tp_subclasses*/
5987 #if PY_VERSION_HEX >= 0x02060000
5988 0, /*tp_version_tag*/
5992 static PyObject *__pyx_tp_new_12pocketsphinx_LatLinkIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
5993 PyObject *o = (*t->tp_alloc)(t, 0);
5995 if (__pyx_pf_12pocketsphinx_15LatLinkIterator___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
5996 Py_DECREF(o); o = 0;
6001 static void __pyx_tp_dealloc_12pocketsphinx_LatLinkIterator(PyObject *o) {
6002 (*Py_TYPE(o)->tp_free)(o);
6005 static PyMethodDef __pyx_methods_12pocketsphinx_LatLinkIterator[] = {
6006 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_12pocketsphinx_15LatLinkIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_15LatLinkIterator___next__)},
6010 static PyNumberMethods __pyx_tp_as_number_LatLinkIterator = {
6014 #if PY_MAJOR_VERSION < 3
6030 #if PY_MAJOR_VERSION < 3
6034 #if PY_MAJOR_VERSION < 3
6040 #if PY_MAJOR_VERSION < 3
6043 #if PY_MAJOR_VERSION < 3
6046 0, /*nb_inplace_add*/
6047 0, /*nb_inplace_subtract*/
6048 0, /*nb_inplace_multiply*/
6049 #if PY_MAJOR_VERSION < 3
6050 0, /*nb_inplace_divide*/
6052 0, /*nb_inplace_remainder*/
6053 0, /*nb_inplace_power*/
6054 0, /*nb_inplace_lshift*/
6055 0, /*nb_inplace_rshift*/
6056 0, /*nb_inplace_and*/
6057 0, /*nb_inplace_xor*/
6058 0, /*nb_inplace_or*/
6059 0, /*nb_floor_divide*/
6060 0, /*nb_true_divide*/
6061 0, /*nb_inplace_floor_divide*/
6062 0, /*nb_inplace_true_divide*/
6063 #if PY_VERSION_HEX >= 0x02050000
6068 static PySequenceMethods __pyx_tp_as_sequence_LatLinkIterator = {
6077 0, /*sq_inplace_concat*/
6078 0, /*sq_inplace_repeat*/
6081 static PyMappingMethods __pyx_tp_as_mapping_LatLinkIterator = {
6084 0, /*mp_ass_subscript*/
6087 static PyBufferProcs __pyx_tp_as_buffer_LatLinkIterator = {
6088 #if PY_MAJOR_VERSION < 3
6089 0, /*bf_getreadbuffer*/
6091 #if PY_MAJOR_VERSION < 3
6092 0, /*bf_getwritebuffer*/
6094 #if PY_MAJOR_VERSION < 3
6095 0, /*bf_getsegcount*/
6097 #if PY_MAJOR_VERSION < 3
6098 0, /*bf_getcharbuffer*/
6100 #if PY_VERSION_HEX >= 0x02060000
6103 #if PY_VERSION_HEX >= 0x02060000
6104 0, /*bf_releasebuffer*/
6108 PyTypeObject __pyx_type_12pocketsphinx_LatLinkIterator = {
6109 PyVarObject_HEAD_INIT(0, 0)
6110 __Pyx_NAMESTR("pocketsphinx.LatLinkIterator"), /*tp_name*/
6111 sizeof(struct __pyx_obj_12pocketsphinx_LatLinkIterator), /*tp_basicsize*/
6113 __pyx_tp_dealloc_12pocketsphinx_LatLinkIterator, /*tp_dealloc*/
6117 #if PY_MAJOR_VERSION < 3
6123 &__pyx_tp_as_number_LatLinkIterator, /*tp_as_number*/
6124 &__pyx_tp_as_sequence_LatLinkIterator, /*tp_as_sequence*/
6125 &__pyx_tp_as_mapping_LatLinkIterator, /*tp_as_mapping*/
6131 &__pyx_tp_as_buffer_LatLinkIterator, /*tp_as_buffer*/
6132 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6133 __Pyx_DOCSTR("\n Iterator over word lattice links.\n "), /*tp_doc*/
6136 0, /*tp_richcompare*/
6137 0, /*tp_weaklistoffset*/
6138 __pyx_pf_12pocketsphinx_15LatLinkIterator___iter__, /*tp_iter*/
6139 __pyx_pf_12pocketsphinx_15LatLinkIterator___next__, /*tp_iternext*/
6140 __pyx_methods_12pocketsphinx_LatLinkIterator, /*tp_methods*/
6147 0, /*tp_dictoffset*/
6150 __pyx_tp_new_12pocketsphinx_LatLinkIterator, /*tp_new*/
6156 0, /*tp_subclasses*/
6159 #if PY_VERSION_HEX >= 0x02060000
6160 0, /*tp_version_tag*/
6163 static struct __pyx_vtabstruct_12pocketsphinx_LatNode __pyx_vtable_12pocketsphinx_LatNode;
6165 static PyObject *__pyx_tp_new_12pocketsphinx_LatNode(PyTypeObject *t, PyObject *a, PyObject *k) {
6166 struct __pyx_obj_12pocketsphinx_LatNode *p;
6167 PyObject *o = (*t->tp_alloc)(t, 0);
6169 p = ((struct __pyx_obj_12pocketsphinx_LatNode *)o);
6170 p->__pyx_vtab = __pyx_vtabptr_12pocketsphinx_LatNode;
6171 p->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); Py_INCREF(Py_None);
6172 if (__pyx_pf_12pocketsphinx_7LatNode___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
6173 Py_DECREF(o); o = 0;
6178 static void __pyx_tp_dealloc_12pocketsphinx_LatNode(PyObject *o) {
6179 struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
6180 Py_XDECREF(((PyObject *)p->best_exit));
6181 (*Py_TYPE(o)->tp_free)(o);
6184 static int __pyx_tp_traverse_12pocketsphinx_LatNode(PyObject *o, visitproc v, void *a) {
6186 struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
6188 e = (*v)(((PyObject*)p->best_exit), a); if (e) return e;
6193 static int __pyx_tp_clear_12pocketsphinx_LatNode(PyObject *o) {
6194 struct __pyx_obj_12pocketsphinx_LatNode *p = (struct __pyx_obj_12pocketsphinx_LatNode *)o;
6196 tmp = ((PyObject*)p->best_exit);
6197 p->best_exit = ((struct __pyx_obj_12pocketsphinx_LatLink *)Py_None); Py_INCREF(Py_None);
6202 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_word(PyObject *o, void *x) {
6203 return __pyx_pf_12pocketsphinx_7LatNode_4word___get__(o);
6206 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_baseword(PyObject *o, void *x) {
6207 return __pyx_pf_12pocketsphinx_7LatNode_8baseword___get__(o);
6210 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_sf(PyObject *o, void *x) {
6211 return __pyx_pf_12pocketsphinx_7LatNode_2sf___get__(o);
6214 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_fef(PyObject *o, void *x) {
6215 return __pyx_pf_12pocketsphinx_7LatNode_3fef___get__(o);
6218 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_lef(PyObject *o, void *x) {
6219 return __pyx_pf_12pocketsphinx_7LatNode_3lef___get__(o);
6222 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_prob(PyObject *o, void *x) {
6223 return __pyx_pf_12pocketsphinx_7LatNode_4prob___get__(o);
6226 static PyObject *__pyx_getprop_12pocketsphinx_7LatNode_best_exit(PyObject *o, void *x) {
6227 return __pyx_pf_12pocketsphinx_7LatNode_9best_exit___get__(o);
6230 static PyMethodDef __pyx_methods_12pocketsphinx_LatNode[] = {
6231 {__Pyx_NAMESTR("exits"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatNode_exits, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatNode_exits)},
6232 {__Pyx_NAMESTR("entries"), (PyCFunction)__pyx_pf_12pocketsphinx_7LatNode_entries, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_7LatNode_entries)},
6236 static struct PyGetSetDef __pyx_getsets_12pocketsphinx_LatNode[] = {
6237 {(char *)"word", __pyx_getprop_12pocketsphinx_7LatNode_word, 0, 0, 0},
6238 {(char *)"baseword", __pyx_getprop_12pocketsphinx_7LatNode_baseword, 0, 0, 0},
6239 {(char *)"sf", __pyx_getprop_12pocketsphinx_7LatNode_sf, 0, 0, 0},
6240 {(char *)"fef", __pyx_getprop_12pocketsphinx_7LatNode_fef, 0, 0, 0},
6241 {(char *)"lef", __pyx_getprop_12pocketsphinx_7LatNode_lef, 0, 0, 0},
6242 {(char *)"prob", __pyx_getprop_12pocketsphinx_7LatNode_prob, 0, 0, 0},
6243 {(char *)"best_exit", __pyx_getprop_12pocketsphinx_7LatNode_best_exit, 0, 0, 0},
6247 static PyNumberMethods __pyx_tp_as_number_LatNode = {
6251 #if PY_MAJOR_VERSION < 3
6267 #if PY_MAJOR_VERSION < 3
6271 #if PY_MAJOR_VERSION < 3
6277 #if PY_MAJOR_VERSION < 3
6280 #if PY_MAJOR_VERSION < 3
6283 0, /*nb_inplace_add*/
6284 0, /*nb_inplace_subtract*/
6285 0, /*nb_inplace_multiply*/
6286 #if PY_MAJOR_VERSION < 3
6287 0, /*nb_inplace_divide*/
6289 0, /*nb_inplace_remainder*/
6290 0, /*nb_inplace_power*/
6291 0, /*nb_inplace_lshift*/
6292 0, /*nb_inplace_rshift*/
6293 0, /*nb_inplace_and*/
6294 0, /*nb_inplace_xor*/
6295 0, /*nb_inplace_or*/
6296 0, /*nb_floor_divide*/
6297 0, /*nb_true_divide*/
6298 0, /*nb_inplace_floor_divide*/
6299 0, /*nb_inplace_true_divide*/
6300 #if PY_VERSION_HEX >= 0x02050000
6305 static PySequenceMethods __pyx_tp_as_sequence_LatNode = {
6314 0, /*sq_inplace_concat*/
6315 0, /*sq_inplace_repeat*/
6318 static PyMappingMethods __pyx_tp_as_mapping_LatNode = {
6321 0, /*mp_ass_subscript*/
6324 static PyBufferProcs __pyx_tp_as_buffer_LatNode = {
6325 #if PY_MAJOR_VERSION < 3
6326 0, /*bf_getreadbuffer*/
6328 #if PY_MAJOR_VERSION < 3
6329 0, /*bf_getwritebuffer*/
6331 #if PY_MAJOR_VERSION < 3
6332 0, /*bf_getsegcount*/
6334 #if PY_MAJOR_VERSION < 3
6335 0, /*bf_getcharbuffer*/
6337 #if PY_VERSION_HEX >= 0x02060000
6340 #if PY_VERSION_HEX >= 0x02060000
6341 0, /*bf_releasebuffer*/
6345 PyTypeObject __pyx_type_12pocketsphinx_LatNode = {
6346 PyVarObject_HEAD_INIT(0, 0)
6347 __Pyx_NAMESTR("pocketsphinx.LatNode"), /*tp_name*/
6348 sizeof(struct __pyx_obj_12pocketsphinx_LatNode), /*tp_basicsize*/
6350 __pyx_tp_dealloc_12pocketsphinx_LatNode, /*tp_dealloc*/
6354 #if PY_MAJOR_VERSION < 3
6360 &__pyx_tp_as_number_LatNode, /*tp_as_number*/
6361 &__pyx_tp_as_sequence_LatNode, /*tp_as_sequence*/
6362 &__pyx_tp_as_mapping_LatNode, /*tp_as_mapping*/
6368 &__pyx_tp_as_buffer_LatNode, /*tp_as_buffer*/
6369 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
6370 __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*/
6371 __pyx_tp_traverse_12pocketsphinx_LatNode, /*tp_traverse*/
6372 __pyx_tp_clear_12pocketsphinx_LatNode, /*tp_clear*/
6373 0, /*tp_richcompare*/
6374 0, /*tp_weaklistoffset*/
6377 __pyx_methods_12pocketsphinx_LatNode, /*tp_methods*/
6379 __pyx_getsets_12pocketsphinx_LatNode, /*tp_getset*/
6384 0, /*tp_dictoffset*/
6387 __pyx_tp_new_12pocketsphinx_LatNode, /*tp_new*/
6393 0, /*tp_subclasses*/
6396 #if PY_VERSION_HEX >= 0x02060000
6397 0, /*tp_version_tag*/
6401 static PyObject *__pyx_tp_new_12pocketsphinx_LatNodeIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
6402 PyObject *o = (*t->tp_alloc)(t, 0);
6407 static void __pyx_tp_dealloc_12pocketsphinx_LatNodeIterator(PyObject *o) {
6408 (*Py_TYPE(o)->tp_free)(o);
6411 static PyMethodDef __pyx_methods_12pocketsphinx_LatNodeIterator[] = {
6412 {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_12pocketsphinx_15LatNodeIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_12pocketsphinx_15LatNodeIterator___next__)},
6416 static PyNumberMethods __pyx_tp_as_number_LatNodeIterator = {
6420 #if PY_MAJOR_VERSION < 3
6436 #if PY_MAJOR_VERSION < 3
6440 #if PY_MAJOR_VERSION < 3
6446 #if PY_MAJOR_VERSION < 3
6449 #if PY_MAJOR_VERSION < 3
6452 0, /*nb_inplace_add*/
6453 0, /*nb_inplace_subtract*/
6454 0, /*nb_inplace_multiply*/
6455 #if PY_MAJOR_VERSION < 3
6456 0, /*nb_inplace_divide*/
6458 0, /*nb_inplace_remainder*/
6459 0, /*nb_inplace_power*/
6460 0, /*nb_inplace_lshift*/
6461 0, /*nb_inplace_rshift*/
6462 0, /*nb_inplace_and*/
6463 0, /*nb_inplace_xor*/
6464 0, /*nb_inplace_or*/
6465 0, /*nb_floor_divide*/
6466 0, /*nb_true_divide*/
6467 0, /*nb_inplace_floor_divide*/
6468 0, /*nb_inplace_true_divide*/
6469 #if PY_VERSION_HEX >= 0x02050000
6474 static PySequenceMethods __pyx_tp_as_sequence_LatNodeIterator = {
6483 0, /*sq_inplace_concat*/
6484 0, /*sq_inplace_repeat*/
6487 static PyMappingMethods __pyx_tp_as_mapping_LatNodeIterator = {
6490 0, /*mp_ass_subscript*/
6493 static PyBufferProcs __pyx_tp_as_buffer_LatNodeIterator = {
6494 #if PY_MAJOR_VERSION < 3
6495 0, /*bf_getreadbuffer*/
6497 #if PY_MAJOR_VERSION < 3
6498 0, /*bf_getwritebuffer*/
6500 #if PY_MAJOR_VERSION < 3
6501 0, /*bf_getsegcount*/
6503 #if PY_MAJOR_VERSION < 3
6504 0, /*bf_getcharbuffer*/
6506 #if PY_VERSION_HEX >= 0x02060000
6509 #if PY_VERSION_HEX >= 0x02060000
6510 0, /*bf_releasebuffer*/
6514 PyTypeObject __pyx_type_12pocketsphinx_LatNodeIterator = {
6515 PyVarObject_HEAD_INIT(0, 0)
6516 __Pyx_NAMESTR("pocketsphinx.LatNodeIterator"), /*tp_name*/
6517 sizeof(struct __pyx_obj_12pocketsphinx_LatNodeIterator), /*tp_basicsize*/
6519 __pyx_tp_dealloc_12pocketsphinx_LatNodeIterator, /*tp_dealloc*/
6523 #if PY_MAJOR_VERSION < 3
6529 &__pyx_tp_as_number_LatNodeIterator, /*tp_as_number*/
6530 &__pyx_tp_as_sequence_LatNodeIterator, /*tp_as_sequence*/
6531 &__pyx_tp_as_mapping_LatNodeIterator, /*tp_as_mapping*/
6537 &__pyx_tp_as_buffer_LatNodeIterator, /*tp_as_buffer*/
6538 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
6539 __Pyx_DOCSTR("\n Iterator over word lattice nodes.\n "), /*tp_doc*/
6542 0, /*tp_richcompare*/
6543 0, /*tp_weaklistoffset*/
6544 __pyx_pf_12pocketsphinx_15LatNodeIterator___iter__, /*tp_iter*/
6545 __pyx_pf_12pocketsphinx_15LatNodeIterator___next__, /*tp_iternext*/
6546 __pyx_methods_12pocketsphinx_LatNodeIterator, /*tp_methods*/
6553 0, /*tp_dictoffset*/
6554 __pyx_pf_12pocketsphinx_15LatNodeIterator___init__, /*tp_init*/
6556 __pyx_tp_new_12pocketsphinx_LatNodeIterator, /*tp_new*/
6562 0, /*tp_subclasses*/
6565 #if PY_VERSION_HEX >= 0x02060000
6566 0, /*tp_version_tag*/
6570 static PyMethodDef __pyx_methods[] = {
6574 #if PY_MAJOR_VERSION >= 3
6575 static struct PyModuleDef __pyx_moduledef = {
6576 PyModuleDef_HEAD_INIT,
6577 __Pyx_NAMESTR("pocketsphinx"),
6580 __pyx_methods /* m_methods */,
6581 NULL, /* m_reload */
6582 NULL, /* m_traverse */
6588 static __Pyx_StringTabEntry __pyx_string_tab[] = {
6589 {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
6590 {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
6591 {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
6592 {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0},
6593 {&__pyx_kp_u_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 0, 0},
6594 {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0},
6595 {&__pyx_kp_u_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 1, 0, 0},
6596 {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
6597 {&__pyx_kp_u_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 1, 0, 0},
6598 {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0},
6599 {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0},
6600 {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0},
6601 {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0},
6602 {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0},
6603 {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0},
6604 {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0},
6605 {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0},
6606 {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0},
6607 {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
6608 {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0},
6609 {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0},
6610 {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0},
6611 {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0},
6612 {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0},
6613 {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0},
6614 {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0},
6615 {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0},
6616 {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
6617 {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
6618 {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
6619 {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
6620 {&__pyx_n_s__Decoder, __pyx_k__Decoder, sizeof(__pyx_k__Decoder), 0, 0, 1, 1},
6621 {&__pyx_n_s__LatLink, __pyx_k__LatLink, sizeof(__pyx_k__LatLink), 0, 0, 1, 1},
6622 {&__pyx_n_s__LatLinkIterator, __pyx_k__LatLinkIterator, sizeof(__pyx_k__LatLinkIterator), 0, 0, 1, 1},
6623 {&__pyx_n_s__LatNode, __pyx_k__LatNode, sizeof(__pyx_k__LatNode), 0, 0, 1, 1},
6624 {&__pyx_n_s__LatNodeIterator, __pyx_k__LatNodeIterator, sizeof(__pyx_k__LatNodeIterator), 0, 0, 1, 1},
6625 {&__pyx_n_s__Lattice, __pyx_k__Lattice, sizeof(__pyx_k__Lattice), 0, 0, 1, 1},
6626 {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
6627 {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
6628 {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
6629 {&__pyx_n_s____next__, __pyx_k____next__, sizeof(__pyx_k____next__), 0, 0, 1, 1},
6630 {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
6631 {&__pyx_n_s__add_word, __pyx_k__add_word, sizeof(__pyx_k__add_word), 0, 0, 1, 1},
6632 {&__pyx_n_s__argc, __pyx_k__argc, sizeof(__pyx_k__argc), 0, 0, 1, 1},
6633 {&__pyx_n_s__argv, __pyx_k__argv, sizeof(__pyx_k__argv), 0, 0, 1, 1},
6634 {&__pyx_n_s__ascale, __pyx_k__ascale, sizeof(__pyx_k__ascale), 0, 0, 1, 1},
6635 {&__pyx_n_s__baseword, __pyx_k__baseword, sizeof(__pyx_k__baseword), 0, 0, 1, 1},
6636 {&__pyx_n_s__best_exit, __pyx_k__best_exit, sizeof(__pyx_k__best_exit), 0, 0, 1, 1},
6637 {&__pyx_n_s__bestpath, __pyx_k__bestpath, sizeof(__pyx_k__bestpath), 0, 0, 1, 1},
6638 {&__pyx_n_s__boxed, __pyx_k__boxed, sizeof(__pyx_k__boxed), 0, 0, 1, 1},
6639 {&__pyx_n_s__dag, __pyx_k__dag, sizeof(__pyx_k__dag), 0, 0, 1, 1},
6640 {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
6641 {&__pyx_n_s__decode_raw, __pyx_k__decode_raw, sizeof(__pyx_k__decode_raw), 0, 0, 1, 1},
6642 {&__pyx_n_s__decode_senscr, __pyx_k__decode_senscr, sizeof(__pyx_k__decode_senscr), 0, 0, 1, 1},
6643 {&__pyx_n_s__dictfile, __pyx_k__dictfile, sizeof(__pyx_k__dictfile), 0, 0, 1, 1},
6644 {&__pyx_n_s__ef, __pyx_k__ef, sizeof(__pyx_k__ef), 0, 0, 1, 1},
6645 {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
6646 {&__pyx_n_s__entries, __pyx_k__entries, sizeof(__pyx_k__entries), 0, 0, 1, 1},
6647 {&__pyx_n_s__exits, __pyx_k__exits, sizeof(__pyx_k__exits), 0, 0, 1, 1},
6648 {&__pyx_n_s__fdictfile, __pyx_k__fdictfile, sizeof(__pyx_k__fdictfile), 0, 0, 1, 1},
6649 {&__pyx_n_s__fef, __pyx_k__fef, sizeof(__pyx_k__fef), 0, 0, 1, 1},
6650 {&__pyx_n_s__fh, __pyx_k__fh, sizeof(__pyx_k__fh), 0, 0, 1, 1},
6651 {&__pyx_n_s__first_link, __pyx_k__first_link, sizeof(__pyx_k__first_link), 0, 0, 1, 1},
6652 {&__pyx_n_s__first_node, __pyx_k__first_node, sizeof(__pyx_k__first_node), 0, 0, 1, 1},
6653 {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
6654 {&__pyx_n_s__full_utt, __pyx_k__full_utt, sizeof(__pyx_k__full_utt), 0, 0, 1, 1},
6655 {&__pyx_n_s__get_hyp, __pyx_k__get_hyp, sizeof(__pyx_k__get_hyp), 0, 0, 1, 1},
6656 {&__pyx_n_s__get_lattice, __pyx_k__get_lattice, sizeof(__pyx_k__get_lattice), 0, 0, 1, 1},
6657 {&__pyx_n_s__get_lmset, __pyx_k__get_lmset, sizeof(__pyx_k__get_lmset), 0, 0, 1, 1},
6658 {&__pyx_n_s__get_prob, __pyx_k__get_prob, sizeof(__pyx_k__get_prob), 0, 0, 1, 1},
6659 {&__pyx_n_s__itor, __pyx_k__itor, sizeof(__pyx_k__itor), 0, 0, 1, 1},
6660 {&__pyx_n_s__latfile, __pyx_k__latfile, sizeof(__pyx_k__latfile), 0, 0, 1, 1},
6661 {&__pyx_n_s__lef, __pyx_k__lef, sizeof(__pyx_k__lef), 0, 0, 1, 1},
6662 {&__pyx_n_s__link, __pyx_k__link, sizeof(__pyx_k__link), 0, 0, 1, 1},
6663 {&__pyx_n_s__lm, __pyx_k__lm, sizeof(__pyx_k__lm), 0, 0, 1, 1},
6664 {&__pyx_n_s__lmset, __pyx_k__lmset, sizeof(__pyx_k__lmset), 0, 0, 1, 1},
6665 {&__pyx_n_s__load_dict, __pyx_k__load_dict, sizeof(__pyx_k__load_dict), 0, 0, 1, 1},
6666 {&__pyx_n_s__log_bowt, __pyx_k__log_bowt, sizeof(__pyx_k__log_bowt), 0, 0, 1, 1},
6667 {&__pyx_n_s__log_prob, __pyx_k__log_prob, sizeof(__pyx_k__log_prob), 0, 0, 1, 1},
6668 {&__pyx_n_s__lw, __pyx_k__lw, sizeof(__pyx_k__lw), 0, 0, 1, 1},
6669 {&__pyx_n_s__lwf, __pyx_k__lwf, sizeof(__pyx_k__lwf), 0, 0, 1, 1},
6670 {&__pyx_n_s__maxsamps, __pyx_k__maxsamps, sizeof(__pyx_k__maxsamps), 0, 0, 1, 1},
6671 {&__pyx_n_s__n_frames, __pyx_k__n_frames, sizeof(__pyx_k__n_frames), 0, 0, 1, 1},
6672 {&__pyx_n_s__no_search, __pyx_k__no_search, sizeof(__pyx_k__no_search), 0, 0, 1, 1},
6673 {&__pyx_n_s__node, __pyx_k__node, sizeof(__pyx_k__node), 0, 0, 1, 1},
6674 {&__pyx_n_s__nodes, __pyx_k__nodes, sizeof(__pyx_k__nodes), 0, 0, 1, 1},
6675 {&__pyx_n_s__phones, __pyx_k__phones, sizeof(__pyx_k__phones), 0, 0, 1, 1},
6676 {&__pyx_n_s__posterior, __pyx_k__posterior, sizeof(__pyx_k__posterior), 0, 0, 1, 1},
6677 {&__pyx_n_s__pred, __pyx_k__pred, sizeof(__pyx_k__pred), 0, 0, 1, 1},
6678 {&__pyx_n_s__prob, __pyx_k__prob, sizeof(__pyx_k__prob), 0, 0, 1, 1},
6679 {&__pyx_n_s__process_raw, __pyx_k__process_raw, sizeof(__pyx_k__process_raw), 0, 0, 1, 1},
6680 {&__pyx_n_s__ps, __pyx_k__ps, sizeof(__pyx_k__ps), 0, 0, 1, 1},
6681 {&__pyx_n_s__ps_end_utt, __pyx_k__ps_end_utt, sizeof(__pyx_k__ps_end_utt), 0, 0, 1, 1},
6682 {&__pyx_n_s__read_dag, __pyx_k__read_dag, sizeof(__pyx_k__read_dag), 0, 0, 1, 1},
6683 {&__pyx_n_s__save_dict, __pyx_k__save_dict, sizeof(__pyx_k__save_dict), 0, 0, 1, 1},
6684 {&__pyx_n_s__set_boxed, __pyx_k__set_boxed, sizeof(__pyx_k__set_boxed), 0, 0, 1, 1},
6685 {&__pyx_n_s__set_dag, __pyx_k__set_dag, sizeof(__pyx_k__set_dag), 0, 0, 1, 1},
6686 {&__pyx_n_s__set_link, __pyx_k__set_link, sizeof(__pyx_k__set_link), 0, 0, 1, 1},
6687 {&__pyx_n_s__set_lm, __pyx_k__set_lm, sizeof(__pyx_k__set_lm), 0, 0, 1, 1},
6688 {&__pyx_n_s__set_lmath, __pyx_k__set_lmath, sizeof(__pyx_k__set_lmath), 0, 0, 1, 1},
6689 {&__pyx_n_s__set_node, __pyx_k__set_node, sizeof(__pyx_k__set_node), 0, 0, 1, 1},
6690 {&__pyx_n_s__sf, __pyx_k__sf, sizeof(__pyx_k__sf), 0, 0, 1, 1},
6691 {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
6692 {&__pyx_n_s__start_utt, __pyx_k__start_utt, sizeof(__pyx_k__start_utt), 0, 0, 1, 1},
6693 {&__pyx_n_s__update, __pyx_k__update, sizeof(__pyx_k__update), 0, 0, 1, 1},
6694 {&__pyx_n_s__uttid, __pyx_k__uttid, sizeof(__pyx_k__uttid), 0, 0, 1, 1},
6695 {&__pyx_n_s__uw, __pyx_k__uw, sizeof(__pyx_k__uw), 0, 0, 1, 1},
6696 {&__pyx_n_s__wip, __pyx_k__wip, sizeof(__pyx_k__wip), 0, 0, 1, 1},
6697 {&__pyx_n_s__word, __pyx_k__word, sizeof(__pyx_k__word), 0, 0, 1, 1},
6698 {&__pyx_n_s__words, __pyx_k__words, sizeof(__pyx_k__words), 0, 0, 1, 1},
6699 {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
6700 {0, 0, 0, 0, 0, 0, 0}
6702 static int __Pyx_InitCachedBuiltins(void) {
6703 __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;}
6704 __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;}
6710 static int __Pyx_InitGlobals(void) {
6711 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6712 __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;};
6713 __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;};
6719 #if PY_MAJOR_VERSION < 3
6720 PyMODINIT_FUNC initpocketsphinx(void); /*proto*/
6721 PyMODINIT_FUNC initpocketsphinx(void)
6723 PyMODINIT_FUNC PyInit_pocketsphinx(void); /*proto*/
6724 PyMODINIT_FUNC PyInit_pocketsphinx(void)
6727 PyObject *__pyx_t_1 = NULL;
6728 PyObject *__pyx_t_2 = NULL;
6729 PyObject *__pyx_t_3 = NULL;
6731 void* __pyx_refnanny = NULL;
6732 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6733 if (!__Pyx_RefNanny) {
6735 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6736 if (!__Pyx_RefNanny)
6737 Py_FatalError("failed to import 'refnanny' module");
6739 __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_pocketsphinx(void)", __LINE__, __FILE__);
6741 __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;}
6742 __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;}
6743 #ifdef __pyx_binding_PyCFunctionType_USED
6744 if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6746 /*--- Library function declarations ---*/
6747 /*--- Threads initialization code ---*/
6748 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6749 #ifdef WITH_THREAD /* Python build with threading support? */
6750 PyEval_InitThreads();
6753 /*--- Module creation code ---*/
6754 #if PY_MAJOR_VERSION < 3
6755 __pyx_m = Py_InitModule4(__Pyx_NAMESTR("pocketsphinx"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
6757 __pyx_m = PyModule_Create(&__pyx_moduledef);
6759 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6760 #if PY_MAJOR_VERSION < 3
6763 __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
6764 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6765 if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
6766 /*--- Initialize various global constants etc. ---*/
6767 if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6768 if (__pyx_module_is_main_pocketsphinx) {
6769 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;};
6771 /*--- Builtin init code ---*/
6772 if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6773 /*--- Global init code ---*/
6774 /*--- Function export code ---*/
6775 /*--- Type init code ---*/
6776 __pyx_vtabptr_12pocketsphinx_Decoder = &__pyx_vtable_12pocketsphinx_Decoder;
6777 #if PY_MAJOR_VERSION >= 3
6778 __pyx_vtable_12pocketsphinx_Decoder.set_boxed = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *))__pyx_f_12pocketsphinx_7Decoder_set_boxed;
6780 *(void(**)(void))&__pyx_vtable_12pocketsphinx_Decoder.set_boxed = (void(*)(void))__pyx_f_12pocketsphinx_7Decoder_set_boxed;
6782 if (PyType_Ready(&__pyx_type_12pocketsphinx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6783 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;}
6784 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;}
6785 __pyx_ptype_12pocketsphinx_Decoder = &__pyx_type_12pocketsphinx_Decoder;
6786 __pyx_vtabptr_12pocketsphinx_Lattice = &__pyx_vtable_12pocketsphinx_Lattice;
6787 #if PY_MAJOR_VERSION >= 3
6788 __pyx_vtable_12pocketsphinx_Lattice.read_dag = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, struct __pyx_obj_12pocketsphinx_Decoder *, PyObject *))__pyx_f_12pocketsphinx_7Lattice_read_dag;
6789 __pyx_vtable_12pocketsphinx_Lattice.set_dag = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, ps_lattice_t *))__pyx_f_12pocketsphinx_7Lattice_set_dag;
6790 __pyx_vtable_12pocketsphinx_Lattice.set_boxed = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_Lattice *, PyObject *))__pyx_f_12pocketsphinx_7Lattice_set_boxed;
6792 *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.read_dag = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_read_dag;
6793 *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.set_dag = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_set_dag;
6794 *(void(**)(void))&__pyx_vtable_12pocketsphinx_Lattice.set_boxed = (void(*)(void))__pyx_f_12pocketsphinx_7Lattice_set_boxed;
6796 if (PyType_Ready(&__pyx_type_12pocketsphinx_Lattice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6797 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;}
6798 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;}
6799 __pyx_ptype_12pocketsphinx_Lattice = &__pyx_type_12pocketsphinx_Lattice;
6800 __pyx_vtabptr_12pocketsphinx_LatLink = &__pyx_vtable_12pocketsphinx_LatLink;
6801 #if PY_MAJOR_VERSION >= 3
6802 __pyx_vtable_12pocketsphinx_LatLink.set_link = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_LatLink *, ps_lattice_t *, ps_latlink_t *))__pyx_f_12pocketsphinx_7LatLink_set_link;
6804 *(void(**)(void))&__pyx_vtable_12pocketsphinx_LatLink.set_link = (void(*)(void))__pyx_f_12pocketsphinx_7LatLink_set_link;
6806 if (PyType_Ready(&__pyx_type_12pocketsphinx_LatLink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6807 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;}
6808 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;}
6809 __pyx_ptype_12pocketsphinx_LatLink = &__pyx_type_12pocketsphinx_LatLink;
6810 if (PyType_Ready(&__pyx_type_12pocketsphinx_LatLinkIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6812 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;}
6813 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
6814 __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
6815 __pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__.doc = __pyx_doc_12pocketsphinx_15LatLinkIterator___next__;
6816 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_12pocketsphinx_15LatLinkIterator___next__;
6819 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;}
6820 __pyx_ptype_12pocketsphinx_LatLinkIterator = &__pyx_type_12pocketsphinx_LatLinkIterator;
6821 __pyx_vtabptr_12pocketsphinx_LatNode = &__pyx_vtable_12pocketsphinx_LatNode;
6822 #if PY_MAJOR_VERSION >= 3
6823 __pyx_vtable_12pocketsphinx_LatNode.set_node = (PyObject *(*)(struct __pyx_obj_12pocketsphinx_LatNode *, ps_lattice_t *, ps_latnode_t *))__pyx_f_12pocketsphinx_7LatNode_set_node;
6825 *(void(**)(void))&__pyx_vtable_12pocketsphinx_LatNode.set_node = (void(*)(void))__pyx_f_12pocketsphinx_7LatNode_set_node;
6827 if (PyType_Ready(&__pyx_type_12pocketsphinx_LatNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6828 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;}
6829 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;}
6830 __pyx_ptype_12pocketsphinx_LatNode = &__pyx_type_12pocketsphinx_LatNode;
6831 if (PyType_Ready(&__pyx_type_12pocketsphinx_LatNodeIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6833 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;}
6834 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
6835 __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
6836 __pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__.doc = __pyx_doc_12pocketsphinx_15LatNodeIterator___next__;
6837 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_12pocketsphinx_15LatNodeIterator___next__;
6840 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;}
6841 __pyx_ptype_12pocketsphinx_LatNodeIterator = &__pyx_type_12pocketsphinx_LatNodeIterator;
6842 /*--- Type import code ---*/
6843 __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;}
6844 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;}
6845 __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;}
6846 __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;}
6847 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;}
6848 __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;}
6849 /*--- Function import code ---*/
6850 /*--- Execution code ---*/
6852 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":499
6853 * raise RuntimeError, "Failed to start utterance processing"
6855 * def process_raw(self, data, no_search=False, full_utt=False): # <<<<<<<<<<<<<<
6857 * Process (decode) some audio data.
6859 __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;}
6860 __Pyx_GOTREF(__pyx_t_1);
6861 __pyx_k_7 = __pyx_t_1;
6862 __Pyx_GIVEREF(__pyx_t_1);
6864 __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;}
6865 __Pyx_GOTREF(__pyx_t_1);
6866 __pyx_k_8 = __pyx_t_1;
6867 __Pyx_GIVEREF(__pyx_t_1);
6870 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":616
6873 * def add_word(self, word, phones, update=True): # <<<<<<<<<<<<<<
6875 * Add a word to the dictionary and current language model.
6877 __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;}
6878 __Pyx_GOTREF(__pyx_t_1);
6879 __pyx_k_15 = __pyx_t_1;
6880 __Pyx_GIVEREF(__pyx_t_1);
6883 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pyx":1
6884 * # Copyright (c) 2008 Carnegie Mellon University. All rights # <<<<<<<<<<<<<<
6888 __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;}
6889 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6890 __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;}
6891 __Pyx_GOTREF(__pyx_t_2);
6892 __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;}
6893 __Pyx_GOTREF(__pyx_t_3);
6894 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6895 __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;}
6896 __Pyx_GOTREF(__pyx_t_2);
6897 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6898 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;}
6899 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6900 __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;}
6901 __Pyx_GOTREF(__pyx_t_2);
6902 __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;}
6903 __Pyx_GOTREF(__pyx_t_3);
6904 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6905 __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;}
6906 __Pyx_GOTREF(__pyx_t_2);
6907 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6908 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;}
6909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6910 __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;}
6911 __Pyx_GOTREF(__pyx_t_2);
6912 __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;}
6913 __Pyx_GOTREF(__pyx_t_3);
6914 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6915 __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;}
6916 __Pyx_GOTREF(__pyx_t_2);
6917 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6918 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;}
6919 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6920 __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;}
6921 __Pyx_GOTREF(__pyx_t_2);
6922 __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;}
6923 __Pyx_GOTREF(__pyx_t_3);
6924 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6925 __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;}
6926 __Pyx_GOTREF(__pyx_t_2);
6927 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6928 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;}
6929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6930 __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;}
6931 __Pyx_GOTREF(__pyx_t_2);
6932 __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;}
6933 __Pyx_GOTREF(__pyx_t_3);
6934 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6935 __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;}
6936 __Pyx_GOTREF(__pyx_t_2);
6937 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6938 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;}
6939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6940 __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;}
6941 __Pyx_GOTREF(__pyx_t_2);
6942 __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;}
6943 __Pyx_GOTREF(__pyx_t_3);
6944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6945 __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;}
6946 __Pyx_GOTREF(__pyx_t_2);
6947 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6948 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;}
6949 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6950 __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;}
6951 __Pyx_GOTREF(__pyx_t_2);
6952 __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;}
6953 __Pyx_GOTREF(__pyx_t_3);
6954 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6955 __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;}
6956 __Pyx_GOTREF(__pyx_t_2);
6957 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6958 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;}
6959 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6960 __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;}
6961 __Pyx_GOTREF(__pyx_t_2);
6962 __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;}
6963 __Pyx_GOTREF(__pyx_t_3);
6964 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6965 __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;}
6966 __Pyx_GOTREF(__pyx_t_2);
6967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6968 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;}
6969 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6970 __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;}
6971 __Pyx_GOTREF(__pyx_t_2);
6972 __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;}
6973 __Pyx_GOTREF(__pyx_t_3);
6974 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6975 __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;}
6976 __Pyx_GOTREF(__pyx_t_2);
6977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6978 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;}
6979 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6980 __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;}
6981 __Pyx_GOTREF(__pyx_t_2);
6982 __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;}
6983 __Pyx_GOTREF(__pyx_t_3);
6984 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6985 __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;}
6986 __Pyx_GOTREF(__pyx_t_2);
6987 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6988 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;}
6989 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6990 __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;}
6991 __Pyx_GOTREF(__pyx_t_2);
6992 __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;}
6993 __Pyx_GOTREF(__pyx_t_3);
6994 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6995 __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;}
6996 __Pyx_GOTREF(__pyx_t_2);
6997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6998 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;}
6999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7000 __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;}
7001 __Pyx_GOTREF(__pyx_t_2);
7002 __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;}
7003 __Pyx_GOTREF(__pyx_t_3);
7004 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7005 __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;}
7006 __Pyx_GOTREF(__pyx_t_2);
7007 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7008 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;}
7009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7010 __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;}
7011 __Pyx_GOTREF(__pyx_t_2);
7012 __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;}
7013 __Pyx_GOTREF(__pyx_t_3);
7014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7015 __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;}
7016 __Pyx_GOTREF(__pyx_t_2);
7017 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7018 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;}
7019 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7020 __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;}
7021 __Pyx_GOTREF(__pyx_t_2);
7022 __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;}
7023 __Pyx_GOTREF(__pyx_t_3);
7024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7025 __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;}
7026 __Pyx_GOTREF(__pyx_t_2);
7027 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7028 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;}
7029 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7030 __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;}
7031 __Pyx_GOTREF(__pyx_t_2);
7032 __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;}
7033 __Pyx_GOTREF(__pyx_t_3);
7034 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7035 __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;}
7036 __Pyx_GOTREF(__pyx_t_2);
7037 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7038 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;}
7039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7040 __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;}
7041 __Pyx_GOTREF(__pyx_t_2);
7042 __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;}
7043 __Pyx_GOTREF(__pyx_t_3);
7044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7045 __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;}
7046 __Pyx_GOTREF(__pyx_t_2);
7047 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7048 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;}
7049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7050 __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;}
7051 __Pyx_GOTREF(__pyx_t_2);
7052 __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;}
7053 __Pyx_GOTREF(__pyx_t_3);
7054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7055 __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;}
7056 __Pyx_GOTREF(__pyx_t_2);
7057 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7058 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;}
7059 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7060 __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;}
7061 __Pyx_GOTREF(__pyx_t_2);
7062 __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;}
7063 __Pyx_GOTREF(__pyx_t_3);
7064 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7065 __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;}
7066 __Pyx_GOTREF(__pyx_t_2);
7067 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7068 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;}
7069 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7070 __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;}
7071 __Pyx_GOTREF(__pyx_t_2);
7072 __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;}
7073 __Pyx_GOTREF(__pyx_t_3);
7074 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7075 __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;}
7076 __Pyx_GOTREF(__pyx_t_2);
7077 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7078 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;}
7079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7080 __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;}
7081 __Pyx_GOTREF(__pyx_t_2);
7082 __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;}
7083 __Pyx_GOTREF(__pyx_t_3);
7084 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7085 __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;}
7086 __Pyx_GOTREF(__pyx_t_2);
7087 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7088 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;}
7089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7090 __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;}
7091 __Pyx_GOTREF(__pyx_t_2);
7092 __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;}
7093 __Pyx_GOTREF(__pyx_t_3);
7094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7095 __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;}
7096 __Pyx_GOTREF(__pyx_t_2);
7097 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7098 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;}
7099 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7100 __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;}
7101 __Pyx_GOTREF(__pyx_t_2);
7102 __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;}
7103 __Pyx_GOTREF(__pyx_t_3);
7104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7105 __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;}
7106 __Pyx_GOTREF(__pyx_t_2);
7107 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7108 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;}
7109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7110 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;}
7111 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
7113 /* "/home/shmyrev/projects/asr/pocketsphinx/python/pocketsphinx.pxd":170
7114 * cdef readonly int sf, fef, lef
7115 * cdef readonly double prob
7116 * cdef readonly LatLink best_exit # <<<<<<<<<<<<<<
7117 * cdef set_node(LatNode self, ps_lattice_t *dag, ps_latnode_t *node)
7122 __Pyx_XDECREF(__pyx_t_1);
7123 __Pyx_XDECREF(__pyx_t_2);
7124 __Pyx_XDECREF(__pyx_t_3);
7126 __Pyx_AddTraceback("init pocketsphinx");
7127 Py_DECREF(__pyx_m); __pyx_m = 0;
7128 } else if (!PyErr_Occurred()) {
7129 PyErr_SetString(PyExc_ImportError, "init pocketsphinx");
7132 __Pyx_RefNannyFinishContext();
7133 #if PY_MAJOR_VERSION < 3
7140 /* Runtime support code */
7142 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
7144 result = PyObject_GetAttr(dict, name);
7146 PyErr_SetObject(PyExc_NameError, name);
7150 static void __Pyx_RaiseArgtupleInvalid(
7151 const char* func_name,
7155 Py_ssize_t num_found)
7157 Py_ssize_t num_expected;
7158 const char *number, *more_or_less;
7160 if (num_found < num_min) {
7161 num_expected = num_min;
7162 more_or_less = "at least";
7164 num_expected = num_max;
7165 more_or_less = "at most";
7168 more_or_less = "exactly";
7170 number = (num_expected == 1) ? "" : "s";
7171 PyErr_Format(PyExc_TypeError,
7172 #if PY_VERSION_HEX < 0x02050000
7173 "%s() takes %s %d positional argument%s (%d given)",
7175 "%s() takes %s %zd positional argument%s (%zd given)",
7177 func_name, more_or_less, num_expected, number, num_found);
7180 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
7182 const char* function_name,
7187 while (PyDict_Next(kwdict, &pos, &key, 0)) {
7188 #if PY_MAJOR_VERSION < 3
7189 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
7191 if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
7193 goto invalid_keyword_type;
7195 if ((!kw_allowed) && unlikely(key))
7196 goto invalid_keyword;
7198 invalid_keyword_type:
7199 PyErr_Format(PyExc_TypeError,
7200 "%s() keywords must be strings", function_name);
7203 PyErr_Format(PyExc_TypeError,
7204 #if PY_MAJOR_VERSION < 3
7205 "%s() got an unexpected keyword argument '%s'",
7206 function_name, PyString_AsString(key));
7208 "%s() got an unexpected keyword argument '%U'",
7209 function_name, key);
7214 static void __Pyx_RaiseDoubleKeywordsError(
7215 const char* func_name,
7218 PyErr_Format(PyExc_TypeError,
7219 #if PY_MAJOR_VERSION >= 3
7220 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7222 "%s() got multiple values for keyword argument '%s'", func_name,
7223 PyString_AS_STRING(kw_name));
7227 static int __Pyx_ParseOptionalKeywords(
7229 PyObject **argnames[],
7232 Py_ssize_t num_pos_args,
7233 const char* function_name)
7235 PyObject *key = 0, *value = 0;
7238 PyObject*** first_kw_arg = argnames + num_pos_args;
7240 while (PyDict_Next(kwds, &pos, &key, &value)) {
7241 name = first_kw_arg;
7242 while (*name && (**name != key)) name++;
7244 values[name-argnames] = value;
7246 #if PY_MAJOR_VERSION < 3
7247 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
7249 if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
7251 goto invalid_keyword_type;
7253 for (name = first_kw_arg; *name; name++) {
7254 #if PY_MAJOR_VERSION >= 3
7255 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
7256 PyUnicode_Compare(**name, key) == 0) break;
7258 if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
7259 _PyString_Eq(**name, key)) break;
7263 values[name-argnames] = value;
7265 /* unexpected keyword found */
7266 for (name=argnames; name != first_kw_arg; name++) {
7267 if (**name == key) goto arg_passed_twice;
7268 #if PY_MAJOR_VERSION >= 3
7269 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
7270 PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
7272 if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
7273 _PyString_Eq(**name, key)) goto arg_passed_twice;
7277 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7279 goto invalid_keyword;
7287 __Pyx_RaiseDoubleKeywordsError(function_name, **name);
7289 invalid_keyword_type:
7290 PyErr_Format(PyExc_TypeError,
7291 "%s() keywords must be strings", function_name);
7294 PyErr_Format(PyExc_TypeError,
7295 #if PY_MAJOR_VERSION < 3
7296 "%s() got an unexpected keyword argument '%s'",
7297 function_name, PyString_AsString(key));
7299 "%s() got an unexpected keyword argument '%U'",
7300 function_name, key);
7306 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
7307 if (unlikely(!type)) {
7308 PyErr_Format(PyExc_SystemError, "Missing type object");
7311 if (likely(PyObject_TypeCheck(obj, type)))
7313 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
7314 Py_TYPE(obj)->tp_name, type->tp_name);
7318 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
7319 const char *name, int exact)
7322 PyErr_Format(PyExc_SystemError, "Missing type object");
7325 if (none_allowed && obj == Py_None) return 1;
7327 if (Py_TYPE(obj) == type) return 1;
7330 if (PyObject_TypeCheck(obj, type)) return 1;
7332 PyErr_Format(PyExc_TypeError,
7333 "Argument '%s' has incorrect type (expected %s, got %s)",
7334 name, type->tp_name, Py_TYPE(obj)->tp_name);
7338 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
7339 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7342 static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
7343 PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
7347 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
7348 PyObject *tmp_type, *tmp_value, *tmp_tb;
7349 PyThreadState *tstate = PyThreadState_GET();
7351 tmp_type = tstate->curexc_type;
7352 tmp_value = tstate->curexc_value;
7353 tmp_tb = tstate->curexc_traceback;
7354 tstate->curexc_type = type;
7355 tstate->curexc_value = value;
7356 tstate->curexc_traceback = tb;
7357 Py_XDECREF(tmp_type);
7358 Py_XDECREF(tmp_value);
7362 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
7363 PyThreadState *tstate = PyThreadState_GET();
7364 *type = tstate->curexc_type;
7365 *value = tstate->curexc_value;
7366 *tb = tstate->curexc_traceback;
7368 tstate->curexc_type = 0;
7369 tstate->curexc_value = 0;
7370 tstate->curexc_traceback = 0;
7374 #if PY_MAJOR_VERSION < 3
7375 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
7379 /* First, check the traceback argument, replacing None with NULL. */
7380 if (tb == Py_None) {
7384 else if (tb != NULL && !PyTraceBack_Check(tb)) {
7385 PyErr_SetString(PyExc_TypeError,
7386 "raise: arg 3 must be a traceback or None");
7389 /* Next, replace a missing value with None */
7390 if (value == NULL) {
7394 #if PY_VERSION_HEX < 0x02050000
7395 if (!PyClass_Check(type))
7397 if (!PyType_Check(type))
7400 /* Raising an instance. The value should be a dummy. */
7401 if (value != Py_None) {
7402 PyErr_SetString(PyExc_TypeError,
7403 "instance exception may not have a separate value");
7406 /* Normalize to raise <class>, <instance> */
7409 #if PY_VERSION_HEX < 0x02050000
7410 if (PyInstance_Check(type)) {
7411 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
7416 PyErr_SetString(PyExc_TypeError,
7417 "raise: exception must be an old-style class or instance");
7421 type = (PyObject*) Py_TYPE(type);
7423 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
7424 PyErr_SetString(PyExc_TypeError,
7425 "raise: exception class must be a subclass of BaseException");
7431 __Pyx_ErrRestore(type, value, tb);
7440 #else /* Python 3+ */
7442 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
7443 if (tb == Py_None) {
7445 } else if (tb && !PyTraceBack_Check(tb)) {
7446 PyErr_SetString(PyExc_TypeError,
7447 "raise: arg 3 must be a traceback or None");
7450 if (value == Py_None)
7453 if (PyExceptionInstance_Check(type)) {
7455 PyErr_SetString(PyExc_TypeError,
7456 "instance exception may not have a separate value");
7460 type = (PyObject*) Py_TYPE(value);
7461 } else if (!PyExceptionClass_Check(type)) {
7462 PyErr_SetString(PyExc_TypeError,
7463 "raise: exception class must be a subclass of BaseException");
7467 PyErr_SetObject(type, value);
7470 PyThreadState *tstate = PyThreadState_GET();
7471 PyObject* tmp_tb = tstate->curexc_traceback;
7474 tstate->curexc_traceback = tb;
7484 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
7485 const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
7486 const int is_unsigned = neg_one > const_zero;
7487 if (sizeof(unsigned char) < sizeof(long)) {
7488 long val = __Pyx_PyInt_AsLong(x);
7489 if (unlikely(val != (long)(unsigned char)val)) {
7490 if (!unlikely(val == -1 && PyErr_Occurred())) {
7491 PyErr_SetString(PyExc_OverflowError,
7492 (is_unsigned && unlikely(val < 0)) ?
7493 "can't convert negative value to unsigned char" :
7494 "value too large to convert to unsigned char");
7496 return (unsigned char)-1;
7498 return (unsigned char)val;
7500 return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
7503 static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
7504 const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
7505 const int is_unsigned = neg_one > const_zero;
7506 if (sizeof(unsigned short) < sizeof(long)) {
7507 long val = __Pyx_PyInt_AsLong(x);
7508 if (unlikely(val != (long)(unsigned short)val)) {
7509 if (!unlikely(val == -1 && PyErr_Occurred())) {
7510 PyErr_SetString(PyExc_OverflowError,
7511 (is_unsigned && unlikely(val < 0)) ?
7512 "can't convert negative value to unsigned short" :
7513 "value too large to convert to unsigned short");
7515 return (unsigned short)-1;
7517 return (unsigned short)val;
7519 return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
7522 static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
7523 const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
7524 const int is_unsigned = neg_one > const_zero;
7525 if (sizeof(unsigned int) < sizeof(long)) {
7526 long val = __Pyx_PyInt_AsLong(x);
7527 if (unlikely(val != (long)(unsigned int)val)) {
7528 if (!unlikely(val == -1 && PyErr_Occurred())) {
7529 PyErr_SetString(PyExc_OverflowError,
7530 (is_unsigned && unlikely(val < 0)) ?
7531 "can't convert negative value to unsigned int" :
7532 "value too large to convert to unsigned int");
7534 return (unsigned int)-1;
7536 return (unsigned int)val;
7538 return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
7541 static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
7542 const char neg_one = (char)-1, const_zero = 0;
7543 const int is_unsigned = neg_one > const_zero;
7544 if (sizeof(char) < sizeof(long)) {
7545 long val = __Pyx_PyInt_AsLong(x);
7546 if (unlikely(val != (long)(char)val)) {
7547 if (!unlikely(val == -1 && PyErr_Occurred())) {
7548 PyErr_SetString(PyExc_OverflowError,
7549 (is_unsigned && unlikely(val < 0)) ?
7550 "can't convert negative value to char" :
7551 "value too large to convert to char");
7557 return (char)__Pyx_PyInt_AsLong(x);
7560 static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
7561 const short neg_one = (short)-1, const_zero = 0;
7562 const int is_unsigned = neg_one > const_zero;
7563 if (sizeof(short) < sizeof(long)) {
7564 long val = __Pyx_PyInt_AsLong(x);
7565 if (unlikely(val != (long)(short)val)) {
7566 if (!unlikely(val == -1 && PyErr_Occurred())) {
7567 PyErr_SetString(PyExc_OverflowError,
7568 (is_unsigned && unlikely(val < 0)) ?
7569 "can't convert negative value to short" :
7570 "value too large to convert to short");
7576 return (short)__Pyx_PyInt_AsLong(x);
7579 static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
7580 const int neg_one = (int)-1, const_zero = 0;
7581 const int is_unsigned = neg_one > const_zero;
7582 if (sizeof(int) < sizeof(long)) {
7583 long val = __Pyx_PyInt_AsLong(x);
7584 if (unlikely(val != (long)(int)val)) {
7585 if (!unlikely(val == -1 && PyErr_Occurred())) {
7586 PyErr_SetString(PyExc_OverflowError,
7587 (is_unsigned && unlikely(val < 0)) ?
7588 "can't convert negative value to int" :
7589 "value too large to convert to int");
7595 return (int)__Pyx_PyInt_AsLong(x);
7598 static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
7599 const signed char neg_one = (signed char)-1, const_zero = 0;
7600 const int is_unsigned = neg_one > const_zero;
7601 if (sizeof(signed char) < sizeof(long)) {
7602 long val = __Pyx_PyInt_AsLong(x);
7603 if (unlikely(val != (long)(signed char)val)) {
7604 if (!unlikely(val == -1 && PyErr_Occurred())) {
7605 PyErr_SetString(PyExc_OverflowError,
7606 (is_unsigned && unlikely(val < 0)) ?
7607 "can't convert negative value to signed char" :
7608 "value too large to convert to signed char");
7610 return (signed char)-1;
7612 return (signed char)val;
7614 return (signed char)__Pyx_PyInt_AsSignedLong(x);
7617 static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
7618 const signed short neg_one = (signed short)-1, const_zero = 0;
7619 const int is_unsigned = neg_one > const_zero;
7620 if (sizeof(signed short) < sizeof(long)) {
7621 long val = __Pyx_PyInt_AsLong(x);
7622 if (unlikely(val != (long)(signed short)val)) {
7623 if (!unlikely(val == -1 && PyErr_Occurred())) {
7624 PyErr_SetString(PyExc_OverflowError,
7625 (is_unsigned && unlikely(val < 0)) ?
7626 "can't convert negative value to signed short" :
7627 "value too large to convert to signed short");
7629 return (signed short)-1;
7631 return (signed short)val;
7633 return (signed short)__Pyx_PyInt_AsSignedLong(x);
7636 static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
7637 const signed int neg_one = (signed int)-1, const_zero = 0;
7638 const int is_unsigned = neg_one > const_zero;
7639 if (sizeof(signed int) < sizeof(long)) {
7640 long val = __Pyx_PyInt_AsLong(x);
7641 if (unlikely(val != (long)(signed int)val)) {
7642 if (!unlikely(val == -1 && PyErr_Occurred())) {
7643 PyErr_SetString(PyExc_OverflowError,
7644 (is_unsigned && unlikely(val < 0)) ?
7645 "can't convert negative value to signed int" :
7646 "value too large to convert to signed int");
7648 return (signed int)-1;
7650 return (signed int)val;
7652 return (signed int)__Pyx_PyInt_AsSignedLong(x);
7655 static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
7656 const int neg_one = (int)-1, const_zero = 0;
7657 const int is_unsigned = neg_one > const_zero;
7658 if (sizeof(int) < sizeof(long)) {
7659 long val = __Pyx_PyInt_AsLong(x);
7660 if (unlikely(val != (long)(int)val)) {
7661 if (!unlikely(val == -1 && PyErr_Occurred())) {
7662 PyErr_SetString(PyExc_OverflowError,
7663 (is_unsigned && unlikely(val < 0)) ?
7664 "can't convert negative value to int" :
7665 "value too large to convert to int");
7671 return (int)__Pyx_PyInt_AsLong(x);
7674 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
7675 const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
7676 const int is_unsigned = neg_one > const_zero;
7677 #if PY_VERSION_HEX < 0x03000000
7678 if (likely(PyInt_Check(x))) {
7679 long val = PyInt_AS_LONG(x);
7680 if (is_unsigned && unlikely(val < 0)) {
7681 PyErr_SetString(PyExc_OverflowError,
7682 "can't convert negative value to unsigned long");
7683 return (unsigned long)-1;
7685 return (unsigned long)val;
7688 if (likely(PyLong_Check(x))) {
7690 if (unlikely(Py_SIZE(x) < 0)) {
7691 PyErr_SetString(PyExc_OverflowError,
7692 "can't convert negative value to unsigned long");
7693 return (unsigned long)-1;
7695 return PyLong_AsUnsignedLong(x);
7697 return PyLong_AsLong(x);
7701 PyObject *tmp = __Pyx_PyNumber_Int(x);
7702 if (!tmp) return (unsigned long)-1;
7703 val = __Pyx_PyInt_AsUnsignedLong(tmp);
7709 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
7710 const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
7711 const int is_unsigned = neg_one > const_zero;
7712 #if PY_VERSION_HEX < 0x03000000
7713 if (likely(PyInt_Check(x))) {
7714 long val = PyInt_AS_LONG(x);
7715 if (is_unsigned && unlikely(val < 0)) {
7716 PyErr_SetString(PyExc_OverflowError,
7717 "can't convert negative value to unsigned PY_LONG_LONG");
7718 return (unsigned PY_LONG_LONG)-1;
7720 return (unsigned PY_LONG_LONG)val;
7723 if (likely(PyLong_Check(x))) {
7725 if (unlikely(Py_SIZE(x) < 0)) {
7726 PyErr_SetString(PyExc_OverflowError,
7727 "can't convert negative value to unsigned PY_LONG_LONG");
7728 return (unsigned PY_LONG_LONG)-1;
7730 return PyLong_AsUnsignedLongLong(x);
7732 return PyLong_AsLongLong(x);
7735 unsigned PY_LONG_LONG val;
7736 PyObject *tmp = __Pyx_PyNumber_Int(x);
7737 if (!tmp) return (unsigned PY_LONG_LONG)-1;
7738 val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
7744 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
7745 const long neg_one = (long)-1, const_zero = 0;
7746 const int is_unsigned = neg_one > const_zero;
7747 #if PY_VERSION_HEX < 0x03000000
7748 if (likely(PyInt_Check(x))) {
7749 long val = PyInt_AS_LONG(x);
7750 if (is_unsigned && unlikely(val < 0)) {
7751 PyErr_SetString(PyExc_OverflowError,
7752 "can't convert negative value to long");
7758 if (likely(PyLong_Check(x))) {
7760 if (unlikely(Py_SIZE(x) < 0)) {
7761 PyErr_SetString(PyExc_OverflowError,
7762 "can't convert negative value to long");
7765 return PyLong_AsUnsignedLong(x);
7767 return PyLong_AsLong(x);
7771 PyObject *tmp = __Pyx_PyNumber_Int(x);
7772 if (!tmp) return (long)-1;
7773 val = __Pyx_PyInt_AsLong(tmp);
7779 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
7780 const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
7781 const int is_unsigned = neg_one > const_zero;
7782 #if PY_VERSION_HEX < 0x03000000
7783 if (likely(PyInt_Check(x))) {
7784 long val = PyInt_AS_LONG(x);
7785 if (is_unsigned && unlikely(val < 0)) {
7786 PyErr_SetString(PyExc_OverflowError,
7787 "can't convert negative value to PY_LONG_LONG");
7788 return (PY_LONG_LONG)-1;
7790 return (PY_LONG_LONG)val;
7793 if (likely(PyLong_Check(x))) {
7795 if (unlikely(Py_SIZE(x) < 0)) {
7796 PyErr_SetString(PyExc_OverflowError,
7797 "can't convert negative value to PY_LONG_LONG");
7798 return (PY_LONG_LONG)-1;
7800 return PyLong_AsUnsignedLongLong(x);
7802 return PyLong_AsLongLong(x);
7806 PyObject *tmp = __Pyx_PyNumber_Int(x);
7807 if (!tmp) return (PY_LONG_LONG)-1;
7808 val = __Pyx_PyInt_AsLongLong(tmp);
7814 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
7815 const signed long neg_one = (signed long)-1, const_zero = 0;
7816 const int is_unsigned = neg_one > const_zero;
7817 #if PY_VERSION_HEX < 0x03000000
7818 if (likely(PyInt_Check(x))) {
7819 long val = PyInt_AS_LONG(x);
7820 if (is_unsigned && unlikely(val < 0)) {
7821 PyErr_SetString(PyExc_OverflowError,
7822 "can't convert negative value to signed long");
7823 return (signed long)-1;
7825 return (signed long)val;
7828 if (likely(PyLong_Check(x))) {
7830 if (unlikely(Py_SIZE(x) < 0)) {
7831 PyErr_SetString(PyExc_OverflowError,
7832 "can't convert negative value to signed long");
7833 return (signed long)-1;
7835 return PyLong_AsUnsignedLong(x);
7837 return PyLong_AsLong(x);
7841 PyObject *tmp = __Pyx_PyNumber_Int(x);
7842 if (!tmp) return (signed long)-1;
7843 val = __Pyx_PyInt_AsSignedLong(tmp);
7849 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
7850 const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
7851 const int is_unsigned = neg_one > const_zero;
7852 #if PY_VERSION_HEX < 0x03000000
7853 if (likely(PyInt_Check(x))) {
7854 long val = PyInt_AS_LONG(x);
7855 if (is_unsigned && unlikely(val < 0)) {
7856 PyErr_SetString(PyExc_OverflowError,
7857 "can't convert negative value to signed PY_LONG_LONG");
7858 return (signed PY_LONG_LONG)-1;
7860 return (signed PY_LONG_LONG)val;
7863 if (likely(PyLong_Check(x))) {
7865 if (unlikely(Py_SIZE(x) < 0)) {
7866 PyErr_SetString(PyExc_OverflowError,
7867 "can't convert negative value to signed PY_LONG_LONG");
7868 return (signed PY_LONG_LONG)-1;
7870 return PyLong_AsUnsignedLongLong(x);
7872 return PyLong_AsLongLong(x);
7875 signed PY_LONG_LONG val;
7876 PyObject *tmp = __Pyx_PyNumber_Int(x);
7877 if (!tmp) return (signed PY_LONG_LONG)-1;
7878 val = __Pyx_PyInt_AsSignedLongLong(tmp);
7884 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
7885 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
7886 PyObject *ob = PyCapsule_New(vtable, 0, 0);
7888 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
7892 if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
7901 #ifndef __PYX_HAVE_RT_ImportType
7902 #define __PYX_HAVE_RT_ImportType
7903 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
7904 long size, int strict)
7906 PyObject *py_module = 0;
7907 PyObject *result = 0;
7908 PyObject *py_name = 0;
7911 py_module = __Pyx_ImportModule(module_name);
7914 #if PY_MAJOR_VERSION < 3
7915 py_name = PyString_FromString(class_name);
7917 py_name = PyUnicode_FromString(class_name);
7921 result = PyObject_GetAttr(py_module, py_name);
7924 Py_DECREF(py_module);
7928 if (!PyType_Check(result)) {
7929 PyErr_Format(PyExc_TypeError,
7930 "%s.%s is not a type object",
7931 module_name, class_name);
7934 if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
7935 PyOS_snprintf(warning, sizeof(warning),
7936 "%s.%s size changed, may indicate binary incompatibility",
7937 module_name, class_name);
7938 #if PY_VERSION_HEX < 0x02050000
7939 PyErr_Warn(NULL, warning);
7941 PyErr_WarnEx(NULL, warning, 0);
7944 else if (((PyTypeObject *)result)->tp_basicsize != size) {
7945 PyErr_Format(PyExc_ValueError,
7946 "%s.%s has the wrong size, try recompiling",
7947 module_name, class_name);
7950 return (PyTypeObject *)result;
7952 Py_XDECREF(py_module);
7958 #ifndef __PYX_HAVE_RT_ImportModule
7959 #define __PYX_HAVE_RT_ImportModule
7960 static PyObject *__Pyx_ImportModule(const char *name) {
7961 PyObject *py_name = 0;
7962 PyObject *py_module = 0;
7964 #if PY_MAJOR_VERSION < 3
7965 py_name = PyString_FromString(name);
7967 py_name = PyUnicode_FromString(name);
7971 py_module = PyImport_Import(py_name);
7975 Py_XDECREF(py_name);
7980 static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
7981 PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
7984 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
7985 *(void **)vtabptr = PyCapsule_GetPointer(ob, 0);
7987 *(void **)vtabptr = PyCObject_AsVoidPtr(ob);
7989 if (!*(void **)vtabptr)
7998 #include "compile.h"
7999 #include "frameobject.h"
8000 #include "traceback.h"
8002 static void __Pyx_AddTraceback(const char *funcname) {
8003 PyObject *py_srcfile = 0;
8004 PyObject *py_funcname = 0;
8005 PyObject *py_globals = 0;
8006 PyCodeObject *py_code = 0;
8007 PyFrameObject *py_frame = 0;
8009 #if PY_MAJOR_VERSION < 3
8010 py_srcfile = PyString_FromString(__pyx_filename);
8012 py_srcfile = PyUnicode_FromString(__pyx_filename);
8014 if (!py_srcfile) goto bad;
8015 if (__pyx_clineno) {
8016 #if PY_MAJOR_VERSION < 3
8017 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
8019 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
8023 #if PY_MAJOR_VERSION < 3
8024 py_funcname = PyString_FromString(funcname);
8026 py_funcname = PyUnicode_FromString(funcname);
8029 if (!py_funcname) goto bad;
8030 py_globals = PyModule_GetDict(__pyx_m);
8031 if (!py_globals) goto bad;
8032 py_code = PyCode_New(
8033 0, /*int argcount,*/
8034 #if PY_MAJOR_VERSION >= 3
8035 0, /*int kwonlyargcount,*/
8038 0, /*int stacksize,*/
8040 __pyx_empty_bytes, /*PyObject *code,*/
8041 __pyx_empty_tuple, /*PyObject *consts,*/
8042 __pyx_empty_tuple, /*PyObject *names,*/
8043 __pyx_empty_tuple, /*PyObject *varnames,*/
8044 __pyx_empty_tuple, /*PyObject *freevars,*/
8045 __pyx_empty_tuple, /*PyObject *cellvars,*/
8046 py_srcfile, /*PyObject *filename,*/
8047 py_funcname, /*PyObject *name,*/
8048 __pyx_lineno, /*int firstlineno,*/
8049 __pyx_empty_bytes /*PyObject *lnotab*/
8051 if (!py_code) goto bad;
8052 py_frame = PyFrame_New(
8053 PyThreadState_GET(), /*PyThreadState *tstate,*/
8054 py_code, /*PyCodeObject *code,*/
8055 py_globals, /*PyObject *globals,*/
8056 0 /*PyObject *locals*/
8058 if (!py_frame) goto bad;
8059 py_frame->f_lineno = __pyx_lineno;
8060 PyTraceBack_Here(py_frame);
8062 Py_XDECREF(py_srcfile);
8063 Py_XDECREF(py_funcname);
8064 Py_XDECREF(py_code);
8065 Py_XDECREF(py_frame);
8068 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8070 #if PY_MAJOR_VERSION < 3
8071 if (t->is_unicode) {
8072 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8073 } else if (t->intern) {
8074 *t->p = PyString_InternFromString(t->s);
8076 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8078 #else /* Python 3+ has unicode identifiers */
8079 if (t->is_unicode | t->is_str) {
8081 *t->p = PyUnicode_InternFromString(t->s);
8082 } else if (t->encoding) {
8083 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8085 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8088 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8098 /* Type Conversion Functions */
8100 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
8101 int is_true = x == Py_True;
8102 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
8103 else return PyObject_IsTrue(x);
8106 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
8108 const char *name = NULL;
8109 PyObject *res = NULL;
8110 #if PY_VERSION_HEX < 0x03000000
8111 if (PyInt_Check(x) || PyLong_Check(x))
8113 if (PyLong_Check(x))
8115 return Py_INCREF(x), x;
8116 m = Py_TYPE(x)->tp_as_number;
8117 #if PY_VERSION_HEX < 0x03000000
8118 if (m && m->nb_int) {
8120 res = PyNumber_Int(x);
8122 else if (m && m->nb_long) {
8124 res = PyNumber_Long(x);
8127 if (m && m->nb_int) {
8129 res = PyNumber_Long(x);
8133 #if PY_VERSION_HEX < 0x03000000
8134 if (!PyInt_Check(res) && !PyLong_Check(res)) {
8136 if (!PyLong_Check(res)) {
8138 PyErr_Format(PyExc_TypeError,
8139 "__%s__ returned non-%s (type %.200s)",
8140 name, name, Py_TYPE(res)->tp_name);
8145 else if (!PyErr_Occurred()) {
8146 PyErr_SetString(PyExc_TypeError,
8147 "an integer is required");
8152 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8154 PyObject* x = PyNumber_Index(b);
8156 ival = PyInt_AsSsize_t(x);
8161 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
8162 #if PY_VERSION_HEX < 0x02050000
8163 if (ival <= LONG_MAX)
8164 return PyInt_FromLong((long)ival);
8166 unsigned char *bytes = (unsigned char *) &ival;
8167 int one = 1; int little = (int)*(unsigned char*)&one;
8168 return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
8171 return PyInt_FromSize_t(ival);
8175 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
8176 unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
8177 if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
8179 } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
8180 PyErr_SetString(PyExc_OverflowError,
8181 "value too large to convert to size_t");
8188 #endif /* Py_PYTHON_H */